Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Need to create a selection screen similar to VA05

Former Member
0 Kudos

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

21 REPLIES 21

Former Member
0 Kudos

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.

Former Member
0 Kudos

Hi Ankit,

Use Set PF status to achieve this.

0 Kudos

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

0 Kudos

Hi,

Try copying the program SAPMV75A ( Program for VA05 )  in Se80 to a Z program and proceed.

BR,

Ankit.

0 Kudos

This message was moderated.

0 Kudos

This message was moderated.

0 Kudos

This message was moderated.

0 Kudos

This message was moderated.

0 Kudos

This message was moderated.

0 Kudos

This message was moderated.

0 Kudos

This message was moderated.

0 Kudos

This message was moderated.

0 Kudos

This message was moderated.

0 Kudos

This message was moderated.

0 Kudos

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

0 Kudos

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.


0 Kudos

using SET PF-STATUS through this only we can achieve it.

0 Kudos

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

Former Member
0 Kudos

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

raymond_giuseppi
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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