Application Development and Automation 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: 
Read only

Dialog programming listbox problem (SE80)

0 Likes
928

Hellooo

I had successfully created a drop down list with data in it. my requirement is whenever i select a drop down list value, some different fields should come in screen. For each drop down list value there should appear different fields. i want this in the same screen.

Thanks in advance.

Regards

Virendra

1 ACCEPTED SOLUTION
Read only

0 Likes
771

hello Ram

your post was really helpful. i have a query... in screen painter, how to assign a user command in a list box. i tried but didnt found any thing... plzzz help me..

with ref to :

"PARAMETERS : lb TYPE char10 VISIBLE LENGTH 3 AS LISTBOX USER-COMMAND lb, " In Screen Painter Create a List bOx and assign a User Command to it"

thanks

Regards

Virendra

5 REPLIES 5
Read only

Sandeep_Panghal
Product and Topic Expert
Product and Topic Expert
0 Likes
771

Do you mean if value 'A' is selected you want to display 3 more i/p field sons creen etc..

You can try using field P_LIST ON INPUT and modify the screen accordingly.

Read only

Former Member
0 Likes
771

Hi

TYPE-POOLS vrm.

PARAMETERS : lb TYPE char10 VISIBLE LENGTH 3 AS LISTBOX USER-COMMAND lb, " In Screen Painter Create a List bOx and assign a User Command to it
             vbeln TYPE vbak-vbeln MODIF ID aa , " Enter AA in Group1 field in Screen Painter
             matnr TYPE mara-matnr MODIF ID bb," Enter BB in Group1 field in Screen Painter
             aufnr TYPE afko-aufnr MODIF ID cc. " " Enter CC in Group1 field in Screen Painter
DATA :  vrm_id TYPE vrm_value-text,
          vrm_values TYPE vrm_value OCCURS 0 WITH HEADER LINE.

AT SELECTION-SCREEN OUTPUT. " Place this code in PBO of Flow Logic
  LOOP AT SCREEN. " Initially all Other Fields are invisible
    IF screen-group1 = 'AA' OR
      screen-group1 = 'BB' OR
      screen-group1 = 'CC'.
      screen-invisible = 1.
      screen-active = 0.
      MODIFY SCREEN.
    ENDIF.
  ENDLOOP.

  REFRESH vrm_values.
  vrm_values-key = 'VBELN'.
  vrm_values     = 'VBELN'.
  APPEND vrm_values.

  vrm_values-key = 'MATNR'.
  vrm_values     = 'MATNR'.
  APPEND vrm_values.

  vrm_values-key = 'AUFNR'.
  vrm_values     = 'AUFNR'.
  APPEND vrm_values.

  vrm_id = 'LB'.
  CALL FUNCTION 'VRM_SET_VALUES' " This provides required values to List Box
    EXPORTING
      id              = vrm_id
      values          = vrm_values[]
    EXCEPTIONS
      id_illegal_name = 1
      OTHERS          = 2.

" This has been discussed many times in SDN and WIKI also do search before posting
  IF lb = 'VBELN'. " Based on the selected Value display the Fields
    LOOP AT SCREEN.
      IF screen-group1 = 'AA'.
        screen-invisible = 0.
        screen-active = 1.
        screen-input = 1.
        SCREEN-OUTPUT = 1        .
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ELSEIF lb = 'MATNR'.
    LOOP AT SCREEN.
      IF screen-group1 = 'BB'.
        screen-invisible = 0.
        screen-active = 1.
        screen-input = 1.
        SCREEN-OUTPUT = 1.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ELSEIF lb  = 'AUFNR'.
    LOOP AT SCREEN.
      IF screen-group1 = 'CC'.
        screen-invisible = 0.
        screen-active = 1.
        screen-input = 1.
        SCREEN-OUTPUT = 1 .
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ENDIF.

Cheerz

Ram

Read only

0 Likes
772

hello Ram

your post was really helpful. i have a query... in screen painter, how to assign a user command in a list box. i tried but didnt found any thing... plzzz help me..

with ref to :

"PARAMETERS : lb TYPE char10 VISIBLE LENGTH 3 AS LISTBOX USER-COMMAND lb, " In Screen Painter Create a List bOx and assign a User Command to it"

thanks

Regards

Virendra

Read only

0 Likes
771

Hi Viru,

In Screen Painter, Double click on the screen element you can see attributes window. There one input field with name FctCode, in this just enter any text like LB for example, and this will trigger automatic PAI/PBO

Hope this as well as I am clear

My advice is to explore and observe carefully every thing in SAP is at our disposal Like F1 help, Key word Documentation, where used List, SDN , google and online Help and Standard Program code etc etc etc

Cheerz

Ram

Read only

0 Likes
771

Thanks buddy...