Continuously run the report in foundation mode even on the press of F8? You could feel, who cares? How to Execute a Report Always in Background mode, even on Press of Function Key F8?
Simply plan a foundation work and you are great. You don’t have to deal with it in your program. In any case, some of the time clients have various plans. They realize that planning the work behind the scenes would be the savviest arrangement, yet, they would demand that they could run it in the closer view through the custom t-code yet and, after its all said and done, the program ought to execute in foundation mode. Insane clients at times. Be that as it may, the Client is God, thusly we can’t contend much with God.
Our answer for this necessity is to make a custom report and all the choice to run the program in closer view mode will be handicapped. Indeed, even at whatever point the client would press the F8 capability key or snap on the execute button and still, at the end of the day the program will show the choice to run in foundation mode. How to Execute a Report Always in Background mode, even on Press of Function Key F8?
Layout design, Logic implemented and step by step process to produce the output (How to Execute a Report Always in Background mode)
Make a report program utilizing the Tcode SE38. Here the report made is ZR_BACKGROUNG_CHECK. To empower the execute button to function as foundation run, we need to compose the code in the occasion AT Choice SCREEN.
We want to allocate the worth ‘SJOB’ which is the Capability Code for the group occupation to the SSCRFIELDS-UCOMM where the worth is either ‘ONLI’ or ‘Executive’.
Framework field SY-UCOMM will hold the worth ‘ONLI’ when the client will either tap on the execution button or press the capability key F8.
The Capability Code ‘Executive’ is characterized inside the custom PF-STATUS which is made sense of underneath.
In the Instatement occasion, we really want to make a custom PF-STATUS. The thought behind production of the PF-STATUS is to alter the PF-STATUS for Choice Screen.
Sample Code:
Double tap on the Introduction occasion and inside this make the custom PF-STATUS. Here the PF-STATUS made is ‘ZCUSTOM‘.
Sample Code:
Double tap on the PF-STATUS name and it will request to make one like beneath screen, click on yes button.
Give a short text and press enter.
Then the beneath screen will show up, here we want to go to menu bar Additional items >Adjust layout.
Pick the SelectionScreen radio button from the format list offered underneath screen chance and afterward press enter.
You can find to see the underneath screen shot where we really want to keep just the expected capability codes and need to eliminate others.
Keep just these Capability Codes offered in the beneath screen chance. Here we have changed the capability code name ‘ONLI’ to ‘Executive’ and have kept the capability key same that is F8.
Actuate the PF-STATUS and the report, upon the execution of the report we can see the 3 fastens that we have given in PF-STATUS.
In the underneath screen shot you can see the from the program menu we have crippled the ‘Execute’ and ‘Execute and Print’ choice.
Sample code:
In the event AT SELECTION-SCREEN OUTPUT, we need to write the below logic to exclude these 2 function code from the program menu.
FORM f_disable_foreground_run. * Local Type Declaration TYPES: BEGIN OF lt_ucomm , ucomm TYPE sy-ucomm, END OF lt_ucomm . * Local Internal Table and WorkArea Declaration DATA : li_ucomm TYPE STANDARD TABLE OF lt_ucomm INITIAL SIZE 0, lk_ucomm TYPE lt_ucomm. * ‘ONLI’ is the Function code of Execution from Program menu lk_ucomm = 'ONLI'. APPEND lk_ucomm TO li_ucomm. CLEAR lk_ucomm. * ‘PRIN’ is the Function code of Execution from Program menu lk_ucomm = 'PRIN'. APPEND lk_ucomm TO li_ucomm. CLEAR lk_ucomm. * Call FM to exclude the function from PF Status CALL FUNCTION 'RS_SET_SELSCREEN_STATUS' EXPORTING p_status = 'ZCUSTOM' TABLES p_exclude = li_ucomm. ENDFORM. " F_DISABLE_FOREGROUND_RUN
Enact the report, execute the report, and feed the choice rules and afterward either press F8 or click on the execution button you can see the beneath screen that we get for foundation run.
Pick the timetable choice from the underneath screen then press the save button.
You can see the booked work and result utilizing the Exchange code SM37.
Highlight recollect: PF-STATUS should be initiated prior to executing the report.
You may be doing UI5 improvement or Fiori execution or may be working in the in-memory data set HANA. In any case, some of the time, the need of the client just need plain vanilla ABAP. Those minutes are unique where you really want to give the creative arrangement which is perfect for the clients utilizing the well established ABAP. What’s more, did anybody attempt to startle you, with all machine learnings(ML) and counterfeit intelligence(AI) and Mechanization, ABAPers could pass on?
In any case, with every one of those mechanization, the requirement for ABAPers would develop more. Afterall, who will do those ML, computer based intelligence and Mechanization programming. . What’s more, who is going to help and support those psycho advancements? May the ABAPers live forever.
So… What Is Your Take?
Presently we need to hear from you.
What is your take? Are ABAPers going to be terminated in not so distant future?
YOU MAY BE LIKE THIS
SAP Custom Development: Tailoring Solutions for Your Business
Cracking the Code: Your Earning Potential as a SAP ABAP Developer with 5 Years of Experience