06-03-2013 3:50 AM
Hi All,
I have a requirement to pull marketing order data and print it using ALV report.
Here I need to create a selection screen which is exactly similar to VA05. Please help me how to create this selection screen.
I am unable to create those pushbuttons at the top (Selection Criteria, Further Selection Criteria).
Also I tried copying the Menu from the program SAPMV45A to my program, however it also didn't worked.
Please help me with a better approach.
Best Regards,
Ankit
06-03-2013 7:47 AM
Check the below sample code to get those pushbuttons at the top:
TABLES: sscrfields.
DATA: d_butt1(4).
PARAMETERS: p_grpa1(10) MODIF ID a,
p_grpa2(10) MODIF ID a,
p_grpb1(10) MODIF ID b.
SELECTION-SCREEN FUNCTION KEY 1.
SELECTION-SCREEN FUNCTION KEY 2.
* data: ls type sscrfields.
INITIALIZATION.
* V_FUNCTXT-ICON_ID = 'SAVE'.
* MOVE V_FUNCTXT-ICON_ID TO sscrfields-functxt_01.
MOVE 'Save' TO sscrfields-functxt_02.
d_butt1 = 'NO'.
AT SELECTION-SCREEN.
IF sy-ucomm = 'FC01'.
d_butt1 = 'SAVE'.
sscrfields-ucomm = 'ONLI'.
ENDIF.
START-OF-SELECTION.
WRITE d_butt1.
DATA: ls_ucomm TYPE sy-ucomm,
lt_ucomm TYPE STANDARD TABLE OF sy-ucomm.
ls_ucomm = 'ONLI'.
APPEND ls_ucomm TO lt_ucomm.
CLEAR ls_ucomm.
ls_ucomm = 'SPOS'.
APPEND ls_ucomm TO lt_ucomm.
CLEAR ls_ucomm.
CALL FUNCTION 'RS_SET_SELSCREEN_STATUS'
EXPORTING
p_status = '%_00'
* P_PROGRAM = ' '
TABLES
p_exclude = lt_ucomm.
06-03-2013 7:51 AM
06-03-2013 8:25 AM
Hi gowtham,
Yes I have tried using it as well, However this didn't worked. I copied the standard_entry menu and used it in my program. This is not working.
Please can anyone help me with the code to get VA05 like selection screen, or can I copy the existing code of standard program and use it in my custom program.
Thanks for your help.
Best Regards,
Ankit
06-03-2013 9:38 AM
Hi,
Try copying the program SAPMV75A ( Program for VA05 ) in Se80 to a Z program and proceed.
BR,
Ankit.
06-03-2013 10:29 AM
06-03-2013 10:29 AM
06-03-2013 10:29 AM
06-03-2013 10:29 AM
06-03-2013 10:29 AM
06-03-2013 10:29 AM
06-03-2013 10:29 AM
06-03-2013 10:29 AM
06-03-2013 10:29 AM
06-03-2013 10:29 AM
06-04-2013 9:42 AM
Hi Ankit,
Thanks for your reply. I know it will work but t will be a very time consuming process since my requirement is to only get va05 like selection screen.
Can you suggest some other aproach, I mean can I create it using module pool program?
If yes can you suggest me steps for doing it.
Thanks,
Ankit
06-04-2013 10:06 AM
Hi Ankith,
Using SET PF-STATUS we can achieve this.
We need to SET PF-STATUS after start-of-selection event. After this we need to specify
AT USER-COMMAND event here we need to write proper logic.
EX:
REPORT ytest_1_1.
START-OF-SELECTION..
SET PF-STATUS 'ZTEST'.
WRITE:/ 'Hi'.
AT USER-COMMAND.
CASE sy-ucomm.
WHEN 'BACK'.
LEAVE PROGRAM.
WHEN 'CANCEL'.
LEAVE PROGRAM.
WHEN 'EXIT'.
LEAVE PROGRAM.
ENDCASE.
06-04-2013 10:58 AM
06-04-2013 12:23 PM
Hi,
Module Pool also would be a bit tedious and controlling the flow via PBO and PAI is tricky. Try PF Status option.
Go to T-code SE80 and enter the Program Name SAPMV75A and check the name of Status's used. Out of those check the one used on screen on VA05 and then copy the same using SE41 to your Z program.
Should help.
Thanks
Ankit
06-04-2013 11:24 AM
Hi Ankit,
You can create Push Buttons like this:
TABLES sscrfields.
TYPE-POOLS icon.
SELECTION-SCREEN:
BEGIN OF SCREEN 500 AS WINDOW TITLE title,
PUSHBUTTON 2(10) but1 USER-COMMAND cli1,
PUSHBUTTON 12(30) but2 USER-COMMAND cli2
VISIBLE LENGTH 10,
END OF SCREEN 500.
AT SELECTION-SCREEN.
CASE sscrfields.
WHEN 'CLI1'.
...
WHEN 'CLI2'.
...
ENDCASE.
START-OF-SELECTION.
title = 'Push button'.
but1 = 'Button 1'.
CALL FUNCTION 'ICON_CREATE'
EXPORTING
name = icon_information
text = 'Button 2'
info = 'My Quickinfo'
IMPORTING
RESULT = but2
EXCEPTIONS
OTHERS = 0.
CALL SELECTION-SCREEN '0500' STARTING AT 10 10.
Best Regards,
Sowmya
06-04-2013 12:07 PM
You need to create some pushbuttons without icon, can be easily done either with a PF-STATUS (*) or with statement SELECTION-SCREEN PUSHBUTTON.
Regards,
Raymond
(*) SET PF-STATUS is not suitable for SELECTION-SCREEN, use a FM like RS_SET_SELSCREEN_STATUS
06-05-2013 7:16 AM
Hi Guys,
Thanks for you replies, However before posting here I have tried SET PF-STATUS but this is not working (When I execute the menu from the standard program I am getting ???????????????????????????????????????????????????????????????????????????????????????????? like this on the menu bar). And the reason for this is the client is on 4.7 version, When I tried this process in other system upgraded one it is running fine.
Thanks for your efforts guys, but unfortunately they didn't worked.
Best Regards,
Ankit