Use of LEAVE LIST-PROCESSING.

LEAVE LIST-PROCESSING: This statement immediately exits the list processor. This statement can be used in various purposes. Let's take one case where it can be sued.


Suppose a user provides any value in the selection-screen parameter and once press F8 , then in the START-OF-SELECTION event let's we validate the value and raise an error message if it is not a valid one. Then the user perspective the selection-screen should appear again where he can specify the correct value but this is not the case. As soon as the error message is raised then the selection screen disappears. In such a situation Leave List-Processing can be used.

Step1. Crate the below report and have an error message.















Step2. Execute and provide the correct value.










Step3. We receive the o/p.











Step4. Provide a different value.













Step5. Well the raised error disappears the selection-screen. Go back.

















Step6. Well home screen is reached.


















Step7. In the validation change the message type and put the statement 'Leave list-processing'.















Step8. run and provide a value.














Step9. The O/P appears.












Step10. Provide a different value.












Step11. We receive the message but still the selection-screen appears enabling the user to provide a correct value.


'SAP Program > ABAP' 카테고리의 다른 글

Number range 관련 재미있는 coding  (0) 2018.02.20
Dialog 화면에서 debugging  (0) 2018.02.06
LEAVE TO LIST-PROCESSING  (0) 2018.02.02
abap source hide & decompress  (0) 2018.01.26
SAP Standard menu exit - MENUSYST  (0) 2018.01.11

설정

트랙백

댓글

Thursday, 11 September 2014

Use of LEAVE TO LIST-PROCESSING .


 LEAVE TO LIST-PROCESSING :  This statement is used when we are processing a screen and want to print our output in a list. In order to navigate from a screen to list LEAVE TO LIST-PROCESSING statement is used with some conditions. The below post describes some of those:

------------------------------------------------------------------------------------------------------------------------
Step1.  Create a report program and create a screen 9999 to take the input & result screen is 9998.






















Step2. Flow logic of 9999 screen.














Step3. The flow logic of screen 9998.
















Step4. Screen design of 9999 that takes input of the field SCARR-CARRID.


















Step5. The pf status of screen 9999.

















Step6. Execute the report & provide an input value AA and Hit the Enter key to trigger the PAI of screen 9999 which calls the screen 9998 and the PBO of the screen 9998 triggers.















Step7.  This is the screen 9998. Click on the Back button.






















Step8. Here the list appears and hit the back button.














Step9. The plain screen of the list still appears. Now click on the back button.













Step10. Again the list with values appears. Hit again the back button.














Step11. Again the Plain list appears.














Conclusion: If in a PBO of the screen we mention : Leave to list-processing, then we unconditionally leave the calling screen ( here the calling screen is - 9999) and the called screen appears( here the called screen is 9998). As we unconditionally left the calling screen, after reaching the called screen (here from 9998 we move to the list ) we can not go back . That why after a several back we can not reach the calling screen.

-------------------------------------------------------------------------------------------------------------------------


Step12. Let's make some change to the statement  LEAVE TO LIST-PROCESSING and add some extra to it :  LEAVE TO LIST-PROCESSING AND RETURN TO SCREEN 0. Execute the report.
This is a conditional call from the calling screen 9999 and after reaching the called screen 9998 it can reach the calling screen by the keyword :  RETURN TO SCREEN 0. This keyword  RETURN TO SCREEN 0 makes the control reach from the list to the calling screen.
























Step13. Provide the I/P and hot enter key.
















Step14. The below screen 9998 appears. Click on Back button.













Step15. Hence the list appears. now again click on the back button.















Step16. Oh great it calls the I/P screen.

















 
Conclusion: Hence the Leave to screen 0 calls the calling screen from the list so the user can provide again a different value in the I/P screen and see the details of the records in the list output. But here also facing some issue.After providing the I/P in the first screen when we hit enter a blank screen of 9998 appears and if we then select the back button then the list appears. So this is not the ideal O/P the user want to accept. So we have to skip this blank screen 9998 and direct proceed to the list O/P.
________________________________________________________________________________


Step17. Then put one extra statement SUPPRESS DIALOG & Execute the report.
























Step18. Provide the i/P and hit enter key from keyboard.
















Step19. So the first  blank screen of 9998 is suppressed ad directly the list appears. click the back button.

















Step20. Again the I/P screen appears bcoz we have mentioned a conditional call Leave to Screen 0.
Again change the I/P and hit Enter key.

















Step21. Again the List appears with fresh set of records.
















 


'SAP Program > ABAP' 카테고리의 다른 글

Dialog 화면에서 debugging  (0) 2018.02.06
LEAVE LIST-PROCESSING  (0) 2018.02.02
abap source hide & decompress  (0) 2018.01.26
SAP Standard menu exit - MENUSYST  (0) 2018.01.11
PO Ack read demo report  (0) 2018.01.03

설정

트랙백

댓글

1은 SE38이거나 "RPY_PROGRAM_READ"함수를 사용하여 코드를 볼 수 있습니다.
모든 코드는 REPOSRC 테이블에 저장되고 압축 모드로 저장됩니다
. 소스 코드를 볼 수 없습니다.

2. 다음 코드 암호화 프로그램하지만 코드가 암호화되면,주의 표기되고 SAP의 소스 코드를 볼 수없는
기준 링크 https://archive.sap.com/discussions/thread/740272을

REPORT z_hide_abap
  NO STANDARD PAGE HEADING.
 
DATA: gt_code(72)  TYPE c OCCURS 0,
      gv_code      LIKE LINE OF gt_code,
      gt_code2(72) TYPE c OCCURS 0.
 
PARAMETERS: program LIKE sy-repid.
 
START-OF-SELECTION.
 
  READ REPORT program INTO gt_code.
 
  IF sy-subrc NE 0.
    MESSAGE e398(00) WITH 'Report' program 'not found.'.
*   ATTENTION:
*   READ REPORT on a hidden source code return SY-SUBRC=8 !!!
  ENDIF. "IF sy-subrc NE 0
 
  READ TABLE gt_code INDEX 1 INTO gv_code.
 
* append *special* 1st line to hide cource code
  APPEND '*@#@@[SAP]' TO gt_code2.
  LOOP AT gt_code INTO gv_code.
    APPEND gv_code TO gt_code2.
  ENDLOOP.
 
  INSERT REPORT program FROM gt_code2.

3. 코드 복원
참조 링크 https://www.daniel-berlin.de/devel/sap-dev/decompress-abap-source-code/

코드 다운로드 https://github.com/daberlin/sap-reposrc-decompressor를
vs2015으로 명령 프롬프트는, 예를 들어 decompress.exe, 소스 코드를 컴파일 생성
ztme11으로, 다음 코드는 암호화 코드를 사용

*&---------------------------------------------------------------------*
*& Report ZS_REPOSRC_DOWNLOAD
*&---------------------------------------------------------------------*
*& Purpose: Download compressed source code from table REPOSRC
*& Author : Daniel Berlin
*& Version: 1.0.1
*& License: CC BY 3.0 (http://creativecommons.org/licenses/by/3.0/)
*&---------------------------------------------------------------------*

REPORT zs_reposrc_download.

DATA: v_fnam TYPE rlgrap-filename,  " Local file name
     v_file TYPE string,           " Same, but as a string
     v_xstr TYPE xstring,          " Source (compressed)
     v_xlen TYPE i,                " Length of source
     t_xtab TYPE TABLE OF x255.    " Source plugged into a table

PARAMETERS: report TYPE progname DEFAULT sy-repid           "#EC *
                  MATCHCODE OBJECT progname OBLIGATORY.

START-OF-SELECTION.

 " -- Select local file name
 WHILE v_fnam IS INITIAL.
   v_fnam = report.

   CALL FUNCTION 'NAVIGATION_FILENAME_HELP'
     EXPORTING
       default_path      = v_fnam
       mode              = 'S'
     IMPORTING
       selected_filename = v_fnam.
 ENDWHILE.

 v_file = v_fnam.

 " -- Fetch compressed source code
 SELECT SINGLE data INTO v_xstr FROM reposrc
         WHERE progname = report AND r3state = 'A'.

 v_xlen = XSTRLEN( v_xstr ).

 " -- Plug source into a table
 CALL METHOD cl_swf_utl_convert_xstring=>xstring_to_table
   EXPORTING
     i_stream = v_xstr
   IMPORTING
     e_table  = t_xtab
   EXCEPTIONS
     OTHERS   = 1.

 " -- Download to local file
 CALL FUNCTION 'GUI_DOWNLOAD'
   EXPORTING
     filetype     = 'BIN'
     filename     = v_file
     bin_filesize = v_xlen
   TABLES
     data_tab     = t_xtab
   EXCEPTIONS
     OTHERS       = 0.

다운로드 한 프로그램이 ztme11이면 ztme11을 decompress.exe가있는 디렉토리로 이동하십시오.
cmd에서 decompress.exe가있는 디렉터리로 전환 한 후 다음 명령을 실행합니다.

  decompress.exe ztme11 ztme11.abap -u

텍스트 편집기를 사용하여 현재 디렉토리를 열고 ztme11.abap, 당신은 암호화하기 전에 코드를 볼 수 있습니다




'SAP Program > ABAP' 카테고리의 다른 글

LEAVE LIST-PROCESSING  (0) 2018.02.02
LEAVE TO LIST-PROCESSING  (0) 2018.02.02
SAP Standard menu exit - MENUSYST  (0) 2018.01.11
PO Ack read demo report  (0) 2018.01.03
USER Role PFCG 관련 BAPI & 권한 관련  (0) 2017.12.27

설정

트랙백

댓글