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: 

Drop-down Menu Problem

former_member216215
Participant
0 Kudos

Hi Everybody,

I have a very big problem drop-down menu.


First, let me explain the problem. I have two linked menu.


Choose from a menu line as well as other menu choices that will vary depending on the line.

But for the global table that is changing all the rows. I want to change a single line.

Example;

Here for the first-line choice we make.


Which are connected to the future of the group.

But as I said, is a global table for all rows are changing.
For example, let's choose the third line.

Accordingly, the group is coming. There is no shortage here. But. Other lines are also changing.
I wanna do I choose the menus in line should be changed. Others do not change.

Any switch this line from the first dropdown group, across the dropdown content should be changed. All of them do not change.

Code let me explain.

WHEN 'GT_PENTP'.

       READ TABLE gt_t062 INDEX gv_changed_row.
       CLEAR gt_t062-saknr .
       MODIFY gt_t062 INDEX gv_changed_row.

       PERFORM set_vrm_for_gt_saknr.

"When I first made ​​a selection from the dropdown group.
"my choice is reading the index of the row.

"it clears the line in the second dropdown.

"And a global table that is selected by the row updating.

"perform is entering.

*&---------------------------------------------------------------------*
*&      Form  SET_VRM_FOR_GT_SAKNR
*&---------------------------------------------------------------------*
FORM set_vrm_for_gt_saknr .

  DATA : t065 TYPE zfi_t065 OCCURS 0 WITH HEADER LINE.

  DATA : id     TYPE vrm_id,
         lt_vat TYPE vrm_values,
         ls_val LIKE LINE OF lt_vat.

  SELECT * FROM zfi_t065
           INTO CORRESPONDING FIELDS OF TABLE  t065
           WHERE pentp EQ gt_t062-pentp. " 1. DROPDOWN selected index

  IF sy-subrc EQ 0.

    SELECT saknr txt50  FROM skat
                        INTO TABLE gt_itab FOR ALL ENTRIES IN t065
                                           WHERE saknr EQ  t065-saknr. 

    LOOP AT t065.
      LOOP AT gt_itab .
        IF gt_itab-saknr EQ t065-saknr.
          MOVE : t065-saknr TO ls_val-key.
          CONCATENATE t065-saknr '-' gt_itab-txt50
                  INTO ls_val-text SEPARATED BY space.
          APPEND ls_val TO lt_vat.
        ELSEIF
          ls_val-key =  ' '.
          ls_val-text = ' '.
          APPEND ls_val TO lt_vat.
        ENDIF.
      ENDLOOP.
    ENDLOOP.
  ENDIF.


  CALL FUNCTION 'VRM_SET_VALUES'
    EXPORTING
      id              = 'GT_T062-SAKNR'     " 2. DROPDOWN
      values          = lt_vat
    EXCEPTIONS
      id_illegal_name = 1
      OTHERS          = 2.

  ENDFORM.                    " SET_VRM_FOR_GT_SAKNR

When I use this code is changing all at once.

Can you help.

Best Regards Rasim.








4 REPLIES 4

Former Member
0 Kudos

One should use VRM_SET_VALUES in the PBO not PAI.

as name GT_T062-SAKNR is the name for all rows in a table-control, it will update all the values in the SAKNR column - SAP cannot know which row to update.

0 Kudos

thanks but i need more detail...

0 Kudos

I am not sure, if you can implement different value-sets for different rows in table control column, search the sdn for those. If it is not possible, implement the same logic with F4 values, not using dropdowns, e.g. like this:

Filtering F4 Help values in Table control, based on other field value - ABAP Development - SCN Wiki

0 Kudos

I understand. Thank you. Shall I continue to research.