‎2013 Apr 03 8:54 AM
Hi all,
Please help me to understand that how to display data using pushbuttons .Have checked on every website regarding mentioned query but not able to understand how my code wil get executed and have mentioned only one or two examples .
Please go through below code and if possible correct it and reply me .
tables : sscrfields, lfa1. " TABLE DECLARATION
data : begin of ty_lfa1 occurs 0 ,
lifnr like lfa1-lifnr,
name1 like lfa1-name1
sortl like lfa1-sortl,
end of ty_lfa1. " STRUCTURE DECLARATION
data : it_lfa1 like standard table of ty_lfa1, " INTERNAL TABLE
wa_lfa1 like ty_lfa1. " WORK AREA
SELECTION-SCREEN BEGIN OF BLOCK b_2 WITH FRAME TITLE text-000.
SELECT-OPTIONS : vendor FOR lfa1-lifnr.
selection-screen skip 3.
SELECTION-SCREEN PUSHBUTTON /1(24) name USER-COMMAND disp. " 1ST PUSHBUTTON
SELECTION-SCREEN PUSHBUTTON /1(24) name USER-COMMAND exit. " 2ND PUSHBUTTON
SELECTION-SCREEN END OF BLOCK b_2.
INITIALIZATION.
DISP = 'DISPLAY'.
EXIT = 'EXIT'.
AT SELECTION-SCREEN.
CASE
‎2013 Apr 03 9:29 AM
Have checked on every website regarding mentioned query
Apparently not on google, scn.sap.com or help.sap.com ?
This is a very basic requirement, Press F1 on some statements and look at statements definitions, function code in statement SELECTION-SCREEN PUSHBUTTON are not variables but already constants that you will check in SSCRFIELDS-UCOMM in AT SELECTION-SCREEN, you missed a "," in your internal table (old fashioned syntax too), etc...
Read theRules of Engagement
Regards,
Raymond
‎2013 Apr 03 10:36 AM
Hi , thanks for your reply .
i know how to display pushbuttons but will you please help to correct my code as i am not able to view data for table lfa1 when pressed display pushbutton .
Please will you please elaborate 'new style' to create pushbutton .
please go through below code and help me to rectify error as why am not able to display data.
tables : sscrfields , lfa1.
data : begin of ty_lfa1 OCCURS 0,
LIFNR like lfa1-lifnr,
LAND1 like lfa1-land1,
NAME1 like lfa1-name1,
ORT01 like lfa1-ort01,
end of ty_lfa1.
data : it_lfa1 LIKE STANDARD TABLE OF ty_lfa1,
wa_lfa1 like ty_lfa1.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECT-OPTIONS : vendor for lfa1-lifnr.
SELECTION-SCREEN SKIP .
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN PUSHBUTTON 5(20) BUT1 USER-COMMAND DISP.
SELECTION-SCREEN PUSHBUTTON 5(20) BUT2 USER-COMMAND EXIT.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK B1.
INITIALIZATION .
BUT1 = 'display'.
BUT2 = 'exit'.
AT SELECTION-SCREEN .
CASE SSCRFIELDS-UCOMM.
WHEN 'DISP'.
SELECT LIFNR LAND1 NAME1 ORT01
FROM LFA1
INTO TABLE IT_LFA1
WHERE LIFNR IN VENDOR.
LOOP AT IT_LFA1 INTO WA_LFA1.
WRITE : / WA_LFA1-LIFNR,
WA_LFA1-LAND1,
WA_LFA1-NAME1,
WA_LFA1-ORT01.
ENDLOOP.
WHEN 'EXIT'.
LEAVE PROGRAM .
ENDCASE.
thanks and regards.
prasad krishna naralkar
‎2013 Apr 03 9:40 AM
Hi Prasad,
i agree with Raymond , This is a very basic requirement.
anyway prasad check the follwing threads how to proceed with push buttons,
it may help you.
http://www.saphub.com/selection-screen/pushbutton-on-abap-selection-screen/
http://searchsap.techtarget.com/tip/Pushbuttons-with-selection-screens
http://saptechnical.com/Tutorials/ABAP/DynamicSScreen/demo.htm
http://www.sapdev.co.uk/reporting/selscr/but_buttons.htm
http://help.sap.com/saphelp_nw04/helpdata/en/9f/dba81635c111d1829f0000e829fbfe/content.htm
http://www.saptechnical.com/Tutorials/ABAP/PushButtons/Index.htm
Regards,
Bastin.G
‎2013 Apr 03 10:37 AM
Hi , thanks for your reply .
i know how to display pushbuttons but will you please help to correct my code as i am not able to view data for table lfa1 when pressed display pushbutton .
Please will you please elaborate 'new style' to create pushbutton .
please go through below code and help me to rectify error as why am not able to display data.
tables : sscrfields , lfa1.
data : begin of ty_lfa1 OCCURS 0,
LIFNR like lfa1-lifnr,
LAND1 like lfa1-land1,
NAME1 like lfa1-name1,
ORT01 like lfa1-ort01,
end of ty_lfa1.
data : it_lfa1 LIKE STANDARD TABLE OF ty_lfa1,
wa_lfa1 like ty_lfa1.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECT-OPTIONS : vendor for lfa1-lifnr.
SELECTION-SCREEN SKIP .
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN PUSHBUTTON 5(20) BUT1 USER-COMMAND DISP.
SELECTION-SCREEN PUSHBUTTON 5(20) BUT2 USER-COMMAND EXIT.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK B1.
INITIALIZATION .
BUT1 = 'display'.
BUT2 = 'exit'.
AT SELECTION-SCREEN .
CASE SSCRFIELDS-UCOMM.
WHEN 'DISP'.
SELECT LIFNR LAND1 NAME1 ORT01
FROM LFA1
INTO TABLE IT_LFA1
WHERE LIFNR IN VENDOR.
LOOP AT IT_LFA1 INTO WA_LFA1.
WRITE : / WA_LFA1-LIFNR,
WA_LFA1-LAND1,
WA_LFA1-NAME1,
WA_LFA1-ORT01.
ENDLOOP.
WHEN 'EXIT'.
LEAVE PROGRAM .
ENDCASE.
‎2013 Apr 03 9:53 AM
‎2013 Apr 03 10:40 AM
Hi , thanks for your reply .
i know how to display pushbuttons but will you please help to correct my code as i am not able to view data for table lfa1 when pressed display pushbutton .
Please will you please elaborate 'new style' to create pushbutton .
please go through below code and help me to rectify error as why am not able to display data.
tables : sscrfields , lfa1.
data : begin of ty_lfa1 OCCURS 0,
LIFNR like lfa1-lifnr,
LAND1 like lfa1-land1,
NAME1 like lfa1-name1,
ORT01 like lfa1-ort01,
end of ty_lfa1.
data : it_lfa1 LIKE STANDARD TABLE OF ty_lfa1,
wa_lfa1 like ty_lfa1.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECT-OPTIONS : vendor for lfa1-lifnr.
SELECTION-SCREEN SKIP .
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN PUSHBUTTON 5(20) BUT1 USER-COMMAND DISP.
SELECTION-SCREEN PUSHBUTTON 5(20) BUT2 USER-COMMAND EXIT.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK B1.
INITIALIZATION .
BUT1 = 'display'.
BUT2 = 'exit'.
AT SELECTION-SCREEN .
CASE SSCRFIELDS-UCOMM.
WHEN 'DISP'.
SELECT LIFNR LAND1 NAME1 ORT01
FROM LFA1
INTO TABLE IT_LFA1
WHERE LIFNR IN VENDOR.
LOOP AT IT_LFA1 INTO WA_LFA1.
WRITE : / WA_LFA1-LIFNR,
WA_LFA1-LAND1,
WA_LFA1-NAME1,
WA_LFA1-ORT01.
ENDLOOP.
WHEN 'EXIT'.
LEAVE PROGRAM .
ENDCASE.
‎2013 Apr 03 11:28 AM
Hi Prasad,
why you are making your program as so much tough.go with simple
based on vendor number ,you have to display vendor details right ?
try with SQVI (Quick Viewer).
if u want push button mandatory means in your selection screen,
Go with Module pool program. you will get it easily.
Regards,
Bastin.G