0% found this document useful (0 votes)
662 views2 pages

Get Cursor Program Example in Sap Abap

The report retrieves data from the BNKA and LFBK tables and displays it to the user. It allows the user to select a record from the BNKA table based on the BANKL or BANKS field, which will then display related records from the LFBK table. It outputs the BANKS, BANKL, BANKA, and BGRUP fields from BNKA, and the BANKS, BANKN, BANKL, and KOINH fields from LFBK. If the user changes pages, a message is displayed to indicate the second page.

Uploaded by

sudhacse
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
Download as txt, pdf, or txt
0% found this document useful (0 votes)
662 views2 pages

Get Cursor Program Example in Sap Abap

The report retrieves data from the BNKA and LFBK tables and displays it to the user. It allows the user to select a record from the BNKA table based on the BANKL or BANKS field, which will then display related records from the LFBK table. It outputs the BANKS, BANKL, BANKA, and BGRUP fields from BNKA, and the BANKS, BANKN, BANKL, and KOINH fields from LFBK. If the user changes pages, a message is displayed to indicate the second page.

Uploaded by

sudhacse
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1/ 2

*&---------------------------------------------------------------------*

*& Report ZGETCURSOROWN


*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT ZGETCURSOROWN.
tables:bnka,lfbk.
TYPES : BEGIN OF st_bnka,
banks TYPE bnka-banks,
banka TYPE bnka-banka,
brnch TYPE bnka-brnch,
bgrup TYPE bnka-bgrup,
bankl TYPE bnka-bankl,
END OF st_bnka.
data:it_bnka TYPE TABLE OF bnka,
wa_bnka TYPE bnka,
it_lfbk TYPE TABLE OF lfbk,
wa_lfbk TYPE lfbk.
data:fname(20),
fvalue TYPE bnka-bankl.
data:fname1(20),
fvalue1 TYPE bnka-banks.
START-OF-SELECTION.
SELECT * from bnka into TABLE it_bnka UP TO 20 ROWS.
WRITE : / 'BANKS', 10 'BANKL' , 30 'BANKA' , 60 'BGRUP'.
WRITE sy-uline.
LOOP AT it_bnka INTO wa_bnka.
WRITE:/ wa_bnka-banks,
wa_bnka-bankl,
wa_bnka-brnch,
wa_bnka-bgrup,
wa_bnka-banka.
ENDLOOP.
AT LINE-SELECTION.
* FOR BANKL FIELD
GET CURSOR FIELD fname VALUE fvalue.
SELECT * FROM lfbk INTO TABLE it_lfbk WHERE bankl = fvalue.
loop at it_lfbk INTO wa_lfbk.
WRITE:/ wa_lfbk-banks , 15 wa_lfbk-bankn, 30 wa_lfbk-bankl , 50 wa_lfb
k-koinh.
ENDLOOP.
* FOR BANKS FIELD
GET CURSOR FIELD fname1 VALUE fvalue1.
SELECT * FROM lfbk INTO TABLE it_lfbk WHERE banks = fvalue1.
loop at it_lfbk INTO wa_lfbk.
WRITE:/ wa_lfbk-banks , 15 wa_lfbk-bankn, 30 wa_lfbk-bankl , 50 wa_lfb
k-koinh.
ENDLOOP.
TOP-OF-PAGE DURING LINE-SELECTION.
write : 'second page' .
write : / 'banks' , 15 'bankn' , 30 'bankl', 50 'koinh'.
*CASE SY-LSIND.
*
*WHEN 1.
*
*WRITE: /'DELIVERY DETAILS REPORT'.
*
*WHEN 2.
*
*WRITE: /'BILLING DETAILS REPORT'.
*
*ENDCASE.

You might also like