Setting: God prohibited, in the event that there is a Creation blackout because of Data set defilement, and your DB Administrator group can’t reestablish the framework completely then a lot of information would be lost. You might have to keep the framework from producing copy Requests/Conveyances/Solicitations and so forth. How to Restore SAP Number Range Object?
In such circumstances (like blackout underway/irregularity in a framework because of DB debasement and so forth) you will be unable to recuperate information till the time the framework went down or irregularity was found and you need to reestablish the number reach objects in the framework to stay away from copy numbers being produced and shipped off clients or to downstream frameworks. How to Restore SAP Number Range Object?
Check the number reach object definition in exchange SNRO/SNUM.
Explore to Altering and actually take a look at the Buffering choice.
Contingent upon the potential upsides of the cushion field (P/X/S/Clear); we will have following cases.
Case 1: If the buffering option is ‘P’ (Local Buffer)
Run the SAP standard ‘NK_REORGANIZE‘ in ‘Test’ mode first and on the off chance that things look great, run it ‘Underway’ mode.
To run this report fill the obligatory field ‘Article’ as the number reach object. If necessary we can utilize Sub-object, Stretch, To Year and Case (Application server occurrences) to restrict the updates. To re-coordinate the entire number reach object itself; we can run with the name of the number reach object. Upon execution, the program will Erase the passages from table ‘NRIV_LOKAL’ and hardly any sections from this table will be reestablished in table ‘NRIV_RESTE’ for reference.
Case 2: If the buffering option is ‘S’ (Parallel Buffering)
Run the SAP standard ‘NK_REORGANIZE’ in ‘Test’ mode first and if things look good then run it in ‘Production’ mode.
To run this report follow a similar methodology as portrayed in point # 1 above. Upon execution, the program will Erase the passages from table ‘NRIVSHADOW’ and hardly any sections from this table will be reestablished in table ‘NRIV_DOCU’ for non-alloted inward numbers.
Case 3: Assuming the buffering choice is ‘X’ (Principal Memory Buffering)
We need to run transaction SM56 to clear the buffer.
To see the current number reach cradle for such number reach objects where Fundamental Memory Buffering (‘X’) is chosen follow the accompanying route in t-code SM56.
If necessary change the ‘NRLEVEL’ of the number reach objects which are affected in SNRO, physically. In the event that a mass change is required, a custom program can be composed to propel the number ‘NRLEVEL’ to the ideal by calling FM ‘NUMBER_GET_NEXT’.
Proposals: In numerous creation frameworks we are as yet utilizing old modifying arrangement for example ‘P’ – Nearby Buffering for not many number reach objects. In this situation, SAP is refreshing all supported sections in table NRIV_LOKAL – Nearby NRIV for multiprocessor machines (This tables passages are subject to Drain Application Occurrence and Discourse process). SAP is not any more supporting Neighborhood Buffering.
SAP is prescribing to utilize ‘S’ – Equal Buffering. So when ‘S’ – Equal Buffering, is actuated, passages are put away in the table NRIVSHADOW – Neighborhood NRIV for multiprocessor machines.
It is almost difficult to keep an engineer from getting to any t-code. We saw a model in our other post named “Might you at any point truly limit any designer from executing any t-code?”. For very nearly 10 years I (and I’m certain, all ABAPers) have been joyfully utilizing the escape clauses in SAP security to get to the prohibited exchanges, with no pernicious intension however, just for expedient examination and moral troubleshooting. Simple SAP Security Breach.
Be that as it may, today I’m pondering, is it actually an escape clause or has SAP given these little windows to the engineers intentionally?
SAP Security Folks!! Trust you are understanding this.
Check, I don’t approach t-code SE38 (ABAP Supervisor) in my Pre-Creation framework. Start our practical on Simple SAP Security Breach.
I additionally don’t approach t-code SE80 (Article Guide/ABAP Workbench), SE37 (Capability Module) and so on in a similar framework.
I really do have approval to the fundamental t-code SE11 (Show Table). You could approach some other normal t-codes (you can utilize that). SE11 is my mysterious window to all the illegal t-codes.
Really look at how ??
I’m in SE11. Click Other Item symbol (Shift + F5) – > Upgraded Choices radio button. Click on the corner square symbol for Program, Capability Gathering or snap ‘More’ to get different regions.
For demo, I picked, Program. Give the program name you need to see. What’s more, here you are in the ABAP proofreader. You can see the code.
Correspondingly you can see, capability modules, administrations, intermediaries, web dynpros and so forth.
As an ABAPer, I’m glad to sort out this elective method for exploring through the t-codes. This cycle is uniquely helpful, when you need to actually look at something truly fast or maintain that should do some examination during certain issues moderation.
Assuming that you go by means of the correct way for example – > ask your administrator for endorsement – > raise ticket for security group – > hang tight for endorsement once more – > sit tight for security group to give you the right access. A few times, you don’t have the freedom of hanging tight and looking for that long. Along these lines, ABAPers rapidly utilize this stunt. Uniquely in quality and pre-creation (where you have the limitation).
Question to Security Folks. Are the engineers assume to get to the t-code by means of this backup way to go? Did you all purposely give this other option? In the event that you know and it is alright to get to along these lines, we are great.
In any case, in the event that Security Folks don’t know about this proviso, then there are chances of greater Security break. SAP Security people can wind up giving a similar option Underway climate as well. If this happens,then there can be serious ramifications and information burglary (and I am aware of clients where you can involve this option Underway climate too).
We might want to hear remarks from Security specialists. Kindly give your viewpoint on this subject. Should Security group not close this other option in the event that the client’s job doesn’t permit him/her to get to specific exchanges?
ABAPers, if it’s not too much trouble, pardon me on the off chance that your entryways get shut. However, I’m certain, no ABAPer need his/her framework and information to be apparent to undesirable convicts. It’s our obligation to make our current circumstance as powerful as could be expected and shield them from any unanticipated covert agent or information hoodlum.
Morever ABAPers would sort out another way, in the event that this one is shut.. ABAPers rock!!!!
Who said SAP is only for Enterprise Resource Planning? (How I used SAP Adobe Form as my personal PDF editor?)
As of late, I had a need to alter a PDF record to address a grammatical mistake in my last name. I was in my office.My office PC and organization has solid restictions. I can’t download and introduce any outer programming. I really want to take help from our office help-work area to introduce any genuine programming. Unfortunately, they didn’t have a PDF manager for us. Also, they didn’t have authorization to introduce free preliminary programming from web.
My necessity was to promptly address my last name. There was an extra ‘H’. Right spelling is Shrestha and it was incorrectly spelled as Shres’H’tha. I would have rather not held up till the night to return home and utilize the PDF supervisor at my own PC. Being an ABAPer, I considered utilizing SAP Adobe Structure. So why pause? I wore my designer’s cap; hit the SAP t-code ‘SFP’ Structure Manufacturer: Section Point.
You can do the underneath steps, regardless of whether you have never worked in Adobe structures. You simply have to have the Adobe LifeCycle Originator introduced in your framework. Fortunately for me, I had it in my framework as a matter of course. Let’s get started on How I used SAP Adobe Form as my personal PDF editor?
Step 1: Go to t-code ‘SFP’ and make the Connection point as displayed beneath. Save it in a vehicle or save as neighborhood object. Actuate it.
Step 2: Go to t-code ‘SFP’ once more and make the Structure. Give the Point of interaction name which you made previously. Save it in transport or save as neighborhood object.
Important: Go to Layout Tab, Tools menu and Import.
This is the most import step. Here we want to import the PDF record which we need to alter. I will choose my document which should be altered. The PDF opens up like in PDF supervisor. Would anything that you like to. We can add lines, change textual styles, colors, add logo/pic and so on. My necessity was to address my last name. I tapped on the line/word and eliminated the extra ‘H’ from my last name (as I was doing in ordinary PDF proofreader).
Go to Print Preview Tab, drift your mouse on the PDF and you see the SAVE symbol. Save it at your ideal objective envelope in your framework and open it to see the new perfect mistake free PDF.
Note: This is certainly not an instructional exercise for SAP Adobe Structure. This is only an illustration of a strange use of SAP Adobe Structure to meet a viable need.
Trust you loved this post. Did you at any point apply any such clever or commonsense arrangements? Might you want to partake in the remark area?
Rather than accomplishing basically everything displayed above, simply follow the underneath steps.
Assuming you preferred it, kindly go ahead and it. Much thanks to you for visiting!!
assumption: Adobe LiveCycle is introduced in your machine
1. Browse: %ProgramFiles(x86)%\Adobe\Designer 9.0\ (or Designer 8.0, which ever version you have) 2. Run: FormDesigner.exe 3. Do your things in the PDF editor
Did you figure it could be ‘1.234’? Or on the other hand assuming that you were infront of the framework and you ended up taking a gander at the information component KWERT and it has 2 decimal. So you figured it would be ‘1.23’. Let’s go into the practical on this question, do all ABAPers know Fixed Point Arithmetic?
Oopss!!! This isn’t the very thing you anticipated. Correct? Presently, you would attempt to challenge this result by really, composing the above lines of code in your framework. What!!! You get an alternate result.
Your result for a similar code.
All in all, for what reason is it different in yours and mine? Allow me to acquaint you with the top story, ‘Fixed Point Number-crunching’ (FPA). My program had the Proper Point Number juggling (menu->go to->attribute) uncontrolled. Yours’ absolute requirement been checked naturally.
As indicated by SAP, Fixed point number-crunching: Assuming that you mark this checkbox, all estimations in the program will utilize fixed point math.
In the event that you don’t choose this actually look at box, stuffed numbers (ABAP/4 sort P, Word reference types CURR, DEC or QUAN) will be treated as whole numbers when they are utilized in tasks, examinations, and computations, regardless of the quantity of decimal spots characterized. Transitional outcomes in math estimations will likewise be adjusted to the following entire number. The quantity of decimal spots characterized is possibly considered when you yield the response utilizing the Compose explanation.
As a program quality, the decent point mathematics decides if for quantities of type p the decimal point is regarded by tasks or not.
Presently, let us see the way of behaving of the beneath code.
* In calling Program
DATA:
v_kwert TYPE kwert,
v_kwert_n TYPE kwert.
v_kwert_n = ( 1000 * '1.234' ) / 1000.
* Calling FM to multiply the same number with 1000 and divide by 1000
CALL FUNCTION 'Elearning'
IMPORTING
xkwert = v_kwert.
WRITE:/ 'From Program: ', 20 v_kwert_n.
WRITE:/ 'From FM: ', 20 v_kwert.
* In FM Elearning.
FUNCTION Elearning.
xkwert = ( 1000 * '1.234' ) / 1000.
ENDFUNCTION.
Check, the numerical articulation is precise in the calling program and called FM. Yet, the result is unique, in light of the fact that the Program has Fixed Point Math unrestrained while the FM has it checked.
Mess about by turning the FPA on and off on the other hand in program and FM and see the result.
SAP unequivocally suggest not turning off the proper point number-crunching in any program.
Genuine Venture Situation: Really look at the down to earth issue, where the client has issue in computation in VOFM routine where the standard SAP program SAPLV61A doesn’t have Fixed Point Math checked.
In such cases, we ought to call a custom FM with Fixed Point Arithimetic checked and do the computation in the FM and pass the last worth to the primary program (VOFM).
With the above gyan (sanskrit word for information), let us check whether we could decide the right result of the beneath code (taken from SAP Help documentation)
CLASS cl_test DEFINITION.
PUBLIC SECTION.
CLASS-METHODS meth RETURNING value(p) TYPE string.
ENDCLASS.
CLASS cl_test IMPLEMENTATION.
METHOD meth.
p = '1000'.
ENDMETHOD.
ENDCLASS.
* Calling in program
START-OF-SELECTION.
DATA v_pack TYPE p DECIMALS 2.
v_pack = cl_test=>meth( ).
write:/ v_pack.
The present Something worth mulling over. I) What might be the result worth of variable v_pack assuming that the Decent Point Number juggling is checked? ii) What might be the result worth of variable v_pack in the event that the Decent Point Number juggling isn’t checked?
Assuming that you enjoyed it, kindly offer it! Much obliged!
Trick to adjust the variants. Say, your variation was turned out great till yesterday and amazingly, you receive message like beneath for a similar variant. ”Variant xxxxxxxxx of program xxxxxxx isn’t the ongoing rendition”. Trick to adjust the variants.
Arrangement: Change or erase the variant.Deleting and reproducing the variation would address the issue. Be that as it may, in the event that you have 100s of variation for a similar report, it would be drawn-out to erase and yet again make.
Better way is to change the variation utilizing program RSVARDOC_610. Go to t-code SE38, enter this program name and execute (F8). In the determination screen, give the program name and variation you need to change. To change all variation then put ‘*’ in the variation name segment. In the event that it isn’t framework variation then keep the SYSVAR area clear.
On the off chance that your SAP framework doesn’t have this program, then search RSVARDOC* and check whether you have any refreshed program for the momentum adaptation of your framework. In the event that you find no other program other than RSVARDOC, utilize this program.
Before going for Background job not listed in transaction SM50. Here and there you might have a foundation work dynamic in your work sign in SM37 which you need to troubleshoot or do some examination at run time. However, shockingly, you probably won’t have the option to see it in Cycle Outline t-code SM50. Let’s get started on background job not listed in transaction SM50.
The above work/report isn’t in the SM50 list underneath.
Solution 1: Your scene should have more than one application servers. So you want to investigate different servers other than the server where SM50 is running. Check the above screen shot. The SM50 was running in server 05. The rundown of servers should be visible from t-code SM51.
Check the work which you are chasing after is available in server 07.
Solution 2: You can likewise see your work in the Worldwide Work Cycle Outline t-code SM66. Check in the underneath screen, there are occupations from various servers(20/02/04/05/07 and so forth). You can see the positions which was absent in SM50 list.
Tip to debug active job: You can investigate the completed foundation occupations planned by your own client id by utilizing order JDBG.
You can investigate the dynamic foundation occupations booked by any client id utilizing t-code SM50/SM51. Select the work, Program/Meeting >Program->Debugging.
A few times it is expected to move the determination variations (made for a report program) starting with one climate then onto the next. We will examine this prerequisite with an example situation. Transport ABAP Report Variants into a Work Bench Request.
Moves toward be followed are: Let’s get started with Transport ABAP Report Variants into a Work Bench Request.
Opening CRM Request in another window (SAP ABAP CRM Tips)
At the point when there is a prerequisite to open a CRM Request (Client Request. Administration Request. and so forth) from a program, the typical interaction is to populate the Business Item Boundary (CRM_OBJECT_ID) with the Exchange Number (OBJECT_ID) and afterward doing a CALL Exchange to CRMD_ORDER. Be that as it may, this technique doesn’t appear to work.
SET Boundary ID ‘CRM_OBJECT_ID’ FIELD . CALL Exchange ‘CRMD_ORDER’ AND Skirt FIRST SCREEN.
It won’t get into the exchange (CRM Request) , however stop at the inquiry screen. The strategy for getting around could be utilizing the BAPI BAPI_BUSPROCESSND_DISPLAY to show the CRM Request. You can utilize it to show the CRM Request screen straightforwardly. Simply pass your Request Header GUID ID to the business cycle and the CRMD_ORDER screen will be shown.
CALL FUNCTION 'BAPI_BUSPROCESSND_DISPLAY'
EXPORTING
business_process = <order_header_guid>
2: Embedding or Erasing Standard/Custom messages in CRM GUI.(SAP ABAP CRM Tips) If conceivable, you can follow the accompanying advances.
a) First delete message, for example * Deleting the messages from stack
Numerous multiple times, freshers in any innovation request genuine Venture models. To those lovers, my idea will be, pick any situation you can imagine, and it tends to be a genuine undertaking situation. Interest and Investigation is the way to learning. At the point when we are interested like a youngster and begin getting clarification on some pressing issues, we sort out fascinating stuffs. As of late, I was looking for certain cafés and their particular courses on Google Guide in some Food Conveyance Android Portable Application. While utilizing the application I figured how it would look on the off chance that we coordinate the Integration of Google Maps JavaScript API with SAPUI5 App and make it a utility device for tracking down a spot, computing distance between two spots, custom marker offices, etc. One of my companions has a mark inscriptions which says “Believing isn’t sufficient, we really want to do”.
I attempted to execute my considerations and ultimately, I was effective in making a good application. In this article, I will exhibit every one of the means in subtleties to accomplish the usefulness.
To coordinate Integration of Google Maps JavaScript API with SAPUI5 App, we really want Google Guide Programming interface. Google has given various APIs viz Google Guide Android Programming interface, Google Guides for iOS, Google Guides for Road, Google Guides Course Programming interface and some more. For our application, we will utilize Google Guides JavaScript Programming interface. The motivation to pick Guides JavaScript Programming interface is basic, it permits us to alter the guides with our own substance and symbolism for show on website pages and cell phones.
Glimpse of the Google Map we integrated (Integration of Google Maps JavaScript API with SAPUI5 App)
To utilize the Google Guides Programming interface, we really want a designer key. Prior to figuring out how to incorporate Google Guides Programming interface with SAPUI5, we want to figure out how to make a designer key?
A. Steps for Creating Google Maps Developer Key
Step 1 : Go to the Google Developers Console
Step 2 : Create a New Project.
Step 3 : Select created Project from list of Projects and Select Dashboard Tab.
Step 4 : Click on API Explore and enable APIs inside Getting Started Tile/Block in same page.
Step 5 : On next page click on Enable APIs and Services button .
Step 6 : After clicking on the button it will navigate to API Library Page. Here select Maps JavaScript API.
Step 7 : On next page click on Enable button, below Maps JavaScript API. Now API will be enabled and we need to create credentials for the same.
Step 8 : Select Credentials tab and click on Hyper Link i.e. Credentials in APIs & Services.
Step 9 : On next page click on CREATE CREDENTIALS button.
Step 10 : Select API key and OAuth Client ID to create the both one by one under CREATE CREDENTIALS button.
Steps 11 : In Left Pane of the console/page under Credential, you can see your project’s API Keys, oAuth Client ID, and Service Accounts details.
Trust you found out about how to make a Google Guides Programming interface Engineer Key and you will actually want to produce the designer key.
Presently how about we move to joining some portion of Google Guides JavaScript Programming interface with SAPUI5 Application.
B. Steps to Integrate Google Maps JavaScript API with SAPUI5
Step 1 : Create an SAPUI5 Application.
Step 2 : Load the Maps JavaScript API.
To stack the Guides JavaScript Programming interface, we really want to utilize a content label which is displayed in underneath model:
Step 3 : Creating DOM Element for the Map.
Step 4 : Creating Map Object and Setting the Map Options (Default Place Coordinates i.e. Latitude and Longitude).
Reclassify onAfterRendering snare strategy for SAPUI5 and compose the beneath code for making Guide Item and setting the Guide Choices/Required Boundaries.
Step 5 : Creating Custom Marker on clicking inside Map and saving the custom data based on requirement.
Pop-up screen code is as below:
Custom Technique for showing Spring up screen and catching/saving the information for the specific made Marker according to the prerequisite. Here the technique I have made is named as fnOnClickPlace which is featured and brought in above screen capture. Source code for this technique is as beneath:
fnSave and fnCancel are functions created in Pop-up Screen for Saving the data and Cancelling the action.
Piece for handling the Caught/Saved information as JSON and utilizing according to prerequisite.
Step 6 : Google Map’sSearch Functionality (Finding/Searching Particular Place)
Here client can find/search any spot across the globe with the assistance of Google’s Strong Google Guides JavaScript Programming interface. The following is the screen captures of the rationale used to accomplish the result.
For testing the carried out Search usefulness of Google Guide, I will look through the spot as ‘Parliament of Delhi’. Subsequent to tapping on Search button, it’s showing the right outcome for example Parliament of India.
Step 7 : Calculating Distance between two places/points
We can really look at the distance between two spots/focuses with the assistance of Google Guides JavaScript Programming interface without any problem. Source Code is as underneath:
For testing the Distance Computation usefulness of our executed SAPUI5 Application, I will track down the distance among Silkboard and Roopena Agrahara. The determined distance between both the focuses is totally right. You might approve it utilizing different sources.
We get it, this is a high level theme and you will have not many questions. If it’s not too much trouble, go ahead and put your inquiries. We will attempt are ideal to answer to give further explanation. Likewise, kindly remark your ideas, criticism for me which will assist me with introducing better instructional exercises in future.
let’s dive into the Real Time Exchange Rate with Real Time Data Using Yahoo Finance API. In the prior posts Google Guide Programming interface in SAP and GPS like apparatus in SAP we perceived how we can use the Google Guide APIs and consume them in SAP. Here, we expand the utilization of comparative APIs to follow the conversion scale continuous. By the constant we mean, it would be invigorated naturally at a decent timespan which we set and it would show the genuine rate for that portion of the time. Why generally Google, this time we would utilize Yippee’s Programming interface. Let’s get into the Real Time Exchange Rate with Real Time Data Using Yahoo Finance API.
This, Yahoo’s Money Programming interface has the underneath structure.
We want to consume it inSAPto show the swapping scale constant and furthermore revive it consequently without the need to stir things up around town button on the screen. Could it be cool, in the event that you are in a Money Association and you project the conversion scale or stock worth on an immense wall from SAP and it gets revived constant for each bystander to see?
Allow us to see what our Application can do.
Give the time span at which you maintain that the outcomes should be revived.
The result is shown for a specific time frame.
Presently, it is revived consequently. The message shows the time at which the information was revived.
Kindly note, there is no invigorate button on the screen. Our Application handles the invigorate.
There is no advanced science. Class Strategy CL_GUI_ALV_GRID->REFRESH_TABLE_DISPLAY is going about our business.
A unique notice of the Class/Connection point CL_GUI_TIMER and Occasion Completed is likewise required.
Really take a look at the Technique TIMER_EVENT in the Class CL_AUTO in the code.
METHODS :display_report,
* Define event handling method for event FINISHED of class CL_GUI_TIMER.
timer_event FOR EVENT finished OF cl_gui_timer.
Conceptually, what is happening?
Occasion Completed of class CL_GUI_TIMER is raised after the Clock has hung tight for the Stretch gave in the choice screen. An audience strategy for Completed occasion is made and the Invigorate rationale is carried out.
Another significant step is to call the Pursue strategy for CL_GUI_TIMER the Invigorate to actuate the time once more.
METHOD timer_event .
DATA: lv_time TYPE char10.
* Get Data
me->get_data( ) .
IF me->ob_grid IS INITIAL .
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
e_grid = ob_grid.
ELSE.
* Refresh the ALV
CALL METHOD ob_grid->refresh_table_display.
ENDIF.
WRITE sy-uzeit TO lv_time USING EDIT MASK '__:__:__'.
CONCATENATE 'Screen refreshed at' lv_time INTO DATA(lv_msg) SEPARATED BY space.
MESSAGE lv_msg TYPE 'S' . " Get the cuuent timE as message
* Call RUN method of CL_GUI_TIMER again to activate timer
me->ob_timer->run( ) .
ENDMETHOD.
This article is a result of exploration done to figure out how to track and follow the vehicle of specialist co-ops like Ola or Uber and so forth. The thought was to utilize the point of interaction/program which we made before where we consumed Google Guide APIs. Be that as it may, tragically, we were unable to sort out any free APIs which would return the specific place of the vehicles constant. Yet, we wound up finding this Programming interface which returned constant stock and conversion scale.
The moves toward consume the Programming interface is the very same as our past articles. Thusly, we have not portrayed them again here. Assuming that you have disarray, if it’s not too much trouble, allude to our prior articles or just put breakpoints in the code and begin troubleshooting. The rationale is clear.
To get such helpful articles straightforwardly to your inbox, kindly Buy in. We regard your security and treat API safeguarding it in a serious way.
Do you have anything to add to this article? Have you confronted any issue utilizing Adobe Structures? Would you like to share any genuine task necessity or arrangements? Kindly let it all out. Kindly leave your considerations in the remark area.
Much thanks for your time!!
We have characterized a design ‘ZAUTO_EXC’ for the beneath application. You could require this too.
The total working code piece for this subject. Kindly reproduce it in your SAP climate and have a great time.
**---------------------------------------------------------------------* ** Date : 07/05/2025 * ** Author : Varad (elearningsolutions) * ** Title : Auto Refresh the Screen Output * **---------------------------------------------------------------------* REPORT elearningsolutions MESSAGE-ID zma.
*&---------------------------------------------------------------------* *& CLASS DEFINATION FOR ADDTING AUTO REFRESH *&---------------------------------------------------------------------* CLASS cl_auto DEFINITION .
PUBLIC SECTION . *&---------------------------------------------------------------------* *& TYPE-POOLS *&---------------------------------------------------------------------* TYPE-POOLS: truxs, slis.
DATA : ob_timer TYPE REF TO cl_gui_timer .
METHODS :display_report, * Define event handling method for event FINISHED of class CL_GUI_TIMER. timer_event FOR EVENT finished OF cl_gui_timer. PRIVATE SECTION .
*&---------------------------------------------------------------------* *& Types and Data *&---------------------------------------------------------------------* TYPES: BEGIN OF ty_dest, time_date TYPE zauto_exc-time_date, ex_type TYPE zauto_exc-ex_type, rate TYPE zauto_exc-rate, time_stamp TYPE zauto_exc-time_stamp, END OF ty_dest.
DATA: gt_dest TYPE STANDARD TABLE OF ty_dest. DATA : ob_grid TYPE REF TO cl_gui_alv_grid . "DISPLAY DATA DATA : gt_dest1 TYPE STANDARD TABLE OF ty_dest.
* Method 2 METHOD http_client_request_get_method. * Request and Get ip_http_client->request->set_header_field( name = '~request_method' value = 'GET' ). ENDMETHOD.
* Local data declaration DATA: lv_url TYPE c LENGTH 255, ls_dest TYPE ty_dest, moff TYPE syst-tabix, moff1 TYPE syst-tabix, lv_len TYPE syst-tabix, lv_ex_type TYPE c LENGTH 20, lv_rate TYPE c LENGTH 20, lv_time_date TYPE c LENGTH 40.
*&---------------------------------------------------------------------* *& Find exchange *&---------------------------------------------------------------------* DO . * Find <location> text in the content string FIND '<field name="name">' IN SECTION OFFSET moff OF ip_content IGNORING CASE MATCH OFFSET moff .
IF sy-subrc = 0 .
moff = moff + 19 .
FIND '</field>' IN SECTION OFFSET moff OF ip_content IGNORING CASE MATCH OFFSET moff1 .
lv_len = moff1 - moff .
lv_ex_type = ip_content+moff(lv_len) .
ls_dest-ex_type = lv_ex_type. *--------------------------------------------------------------------* * ---------------Find rate *--------------------------------------------------------------------* FIND '<field name="price">' IN SECTION OFFSET moff OF ip_content IGNORING CASE MATCH OFFSET moff .
IF sy-subrc = 0 .
moff = moff + 20 .
FIND '</field>' IN SECTION OFFSET moff OF ip_content IGNORING CASE MATCH OFFSET moff1 .
lv_len = moff1 - moff .
lv_rate = ip_content+moff(lv_len) .
ls_dest-rate = lv_rate.
ENDIF.
*============================================================== * Find date and time stamp from api *==============================================================
FIND '<field name="utctime">' IN SECTION OFFSET moff OF ip_content IGNORING CASE MATCH OFFSET moff . IF sy-subrc = 0 .
moff = moff + 22 . FIND '</field>' IN SECTION OFFSET moff OF ip_content IGNORING CASE MATCH OFFSET moff1 . lv_len = moff1 - moff . lv_time_date = ip_content+moff(lv_len) . ls_dest-time_date = lv_time_date.
ENDIF.
* GET TIME form system for verfication . ls_dest-time_stamp = sy-uzeit.
APPEND ls_dest TO gt_dest.
ELSE.
EXIT.
ENDIF.
ENDDO .
ENDMETHOD.
METHOD get_data .
CLEAR: gt_dest.
DATA: lv_http_client TYPE REF TO if_http_client, lv_content TYPE string, lv_url TYPE string.
* Prepare the url of the address lv_url = 'http://finance.yahoo.com/webservice/v1/symbols/allcurrencies/quote'.
*--------------------------------------------------------------------* * Start of Selection *--------------------------------------------------------------------* DATA : ob_auto TYPE REF TO cl_auto, ob_timer TYPE REF TO cl_gui_timer.
*--------------------------------------------------------------------* * Selection Screen Parameters *--------------------------------------------------------------------* PARAMETERS : p_refres TYPE char01 AS CHECKBOX, p_int TYPE i.
*--------------------------------------------------------------------* * Start of Selection *--------------------------------------------------------------------* START-OF-SELECTION.
* Create main object CREATE OBJECT ob_auto .
IF p_refres IS NOT INITIAL .
CREATE OBJECT ob_auto->ob_timer . SET HANDLER ob_auto->timer_event FOR ob_auto->ob_timer .
* Set interval for timer ob_auto->ob_timer->interval = p_int .
* Call method RUN of CL_GUI_TIMER. ob_auto->ob_timer->run( ) .
ENDIF.
*--------------------------------------------------------------------* * End of Selection *--------------------------------------------------------------------* END-OF-SELECTION.
* display dat first time ob_auto->display_report( ) .