‎2008 Mar 11 10:40 AM
Hi All,
What is the User Command? What it means? And how to handle in normal and ALV Report..?
What is happening when I write the statement like below.
SET PARAMETER ID 'TAB' FIELD 'ZPCA' ? What is the purpose of set parameter in the program..?
Akshitha.
‎2008 Mar 11 10:47 AM
Hi,
For USER COMMAND,
Check this
http://help.sap.com/saphelp_nw70/helpdata/en/9f/dba3ae35c111d1829f0000e829fbfe/content.htm
And for SET PARAMETER ID,
http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9e0435c111d1829f0000e829fbfe/content.htm
Hope these helps you understand.
Regards,
Pritha.
Plz reward if helpful.
‎2008 Mar 11 10:50 AM
Hi ,
User command is used to handle GUI events in SAP.
For example if you want to trigger some event on 'BACK , ENTER, STOP' buttons which are on GUI menu bar. You use AT -USER COMMNAD events.
For more refer link :
[http://help.sap.com/saphelp_nw04/helpdata/en/9f/dba3ae35c111d1829f0000e829fbfe/content.htm]
The use of SET parameter is :
SET PARAMETER:
syntax:
SET PARAMETER ID <pid> FIELD <f>.
it is used to store a value of the field in sap memory and it is identified by parameter id(pid).
GET PARAMETER:
syntax:
GET PARAMETER ID<pid> FIELD <f>.
it is used to get data from memory location pid into the given field f.
Hope this will help you.
Regards
Sourabh Verma
‎2008 Mar 11 10:51 AM
Hi,
see this prog..
sy-ucomm is for doing the functions what the user wishes to do at that particular event. You use it in menus and other place . this mainly in using <pfstatus>
USER COMMAND will perform actions on radiobutton click, or wen puhbutton is cliketced
in this if the user clicks a push button, see bold letters..in the prog
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 10(15) lb1.
PARAMETERS : a(10).
SELECTION-SCREEN COMMENT 40(15) lb2.
PARAMETERS : b(10).
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN PUSHBUTTON 10(10) lb3 USER-COMMAND pb1.
SELECTION-SCREEN SKIP.
SELECTION-SCREEN PUSHBUTTON /10(10) lb5 USER-COMMAND pb3.
SELECTION-SCREEN SKIP.
SELECTION-SCREEN PUSHBUTTON /10(10) lb4 USER-COMMAND pb2.
*SELECTION-SCREEN BEGIN OF SCREEN 200 AS WINDOW TITLE T2.
SELECTION-SCREEN BEGIN OF BLOCK b1.
PARAMETERS : ch1 AS CHECKBOX, ch2 AS CHECKBOX, ch3 AS CHECKBOX.
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN BEGIN OF BLOCK b2.
PARAMETERS : rb1 RADIOBUTTON GROUP a,
rb2 RADIOBUTTON GROUP a,
rb3 RADIOBUTTON GROUP a.
SELECTION-SCREEN END OF BLOCK b2.
*SELECTION-SCREEN END OF SCREEN 200.
INITIALIZATION.
lb1 = 'ENTER A VALUE'.
lb2 = 'ENTER B VALUE'.
lb3 = 'DISPLAY'.
lb4 = 'EXIT'.
lb5 = 'CALL NEXT'.
AT SELECTION-SCREEN.
CASE sy-ucomm.
WHEN 'PB1'.
LEAVE TO LIST-PROCESSING.
WRITE : a, b.
IF ch1 = 'X'.
LEAVE TO LIST-PROCESSING.
WRITE 'FIRST CHECKBOX IS SELECTED'.
ENDIF.
IF ch2 = 'X'.
WRITE 😕 'SECOND CHECKBOX IS SELECTED'.
ENDIF.
IF ch3 = 'X'.
WRITE 😕 'THIRD CHECKBOX IS SELECTED'.
ENDIF.
IF rb1 = 'X'.
WRITE 😕 'FIRST RADIOBUTTON'.
ELSEIF rb2 = 'X'.
WRITE 😕 'SECOND RADIOBUTTON'.
ELSEIF rb3 = 'X'.
WRITE 😕 'THIRD RADIOBUTTON'.
ENDIF.
WHEN 'PB2'.
LEAVE PROGRAM.
WHEN 'PB3'.
CALL SELECTION-SCREEN 200.
ENDCASE.
SET parameter :
this is used to pass a value from one report a memory n from there we can use in the same report or the other report..
SAP memory is a memory area to which all main sessions within a SAPgui have access. You can use SAP memory either to pass data from one program to another within a session, or to pass data from one session to another. Application programs that use SAP memory must do so using SPA/GPA parameters (also known as SET/GET parameters). These parameters can be set either for a particular user or for a particular program using the SET PARAMETER statement. Other ABAP programs can then retrieve the set parameters using the GET PARAMETER statement. The most frequent use of SPA/GPA parameters is to fill input fields on screens
Hope this helps u,
Regards,
Arunsri
Edited by: Arunsri on Mar 11, 2008 11:52 AM