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

sastry_gunturi
Active Participant
0 Kudos
gt_values-key = 'R'.
  gt_values-text = text-001.
  append gt_values.

  gt_values-key = 'S'.
  gt_values-text = text-002.
  append gt_values.

  gt_values-key = 'C'.
  gt_values-text = text-003.
  append gt_values.


  call function 'VRM_SET_VALUES'
       exporting
            id              = 'V_SEC_REQ_VAL'
            values          = gt_values[]
       exceptions
            id_illegal_name = 1
            others          = 2.
  if sy-subrc <> 0.
    message id sy-msgid type sy-msgty number sy-msgno
            with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  endif.
  refresh gt_values.

I have written the above code in the include for PBO.

I declared the gt_values in top include.

when i am try to activate i am getting error message

gt_values-key is not defined.......

i am trying to fix this error since last hour

please let me how to fix this error.

4 REPLIES 4

Former Member
0 Kudos

Declare the table gt_values in the Module Pool program.

Sri

Former Member
0 Kudos

add the following in the TOP include of the module pool.

data: gt_values like VRM_VALUES occurs 0 with header line.

Former Member
0 Kudos

Sorry. I did not realize VRM_VALUES is referencing to a type. so you need to do define the following in the TOP include.

TYPE-POOLS vrm.

DATA:

gt_values TYPE vrm_values,

wa_values LIKE LINE OF gt_values.

then in your regular code change to the following.

wa_values-key = 'R'.

wa_values-text = text-001.

append wa_values to gt_values.

wa_values-key = 'S'.

wa_values-text = text-002.

append wa_values to gt_values.

wa_values-key = 'C'.

wa_values-text = text-003.

append wa_values to gt_values.

then finally pass the gt_values to the FM.

hope this helps.

Former Member
0 Kudos

Hi Karthik,

Please refer to the below code for the drop down.

TYPE-POOLS : truxs,vrm.

AT SELECTION-SCREEN OUTPUT.

  • PERFORM populate. "For populating the drop-down list.

CLEAR VALUE.

REFRESH LIST.

NAME = 'KHINR1'.

VALUE-KEY = '1S7_NOCASV'.

VALUE-TEXT = '1S7_NOCASV'.

APPEND VALUE TO LIST.

VALUE-KEY = '1S7_NOCJOT'.

VALUE-TEXT = '1S7_NOCJOT'.

APPEND VALUE TO LIST.

LOOP AT SCREEN. "For toggling between the selection screens.

IF r1 EQ 'X'.

IF screen-group1 = 'SAM'.

screen-active = 0.

ENDIF.

ELSEIF r2 EQ 'X'.

IF screen-group1 = 'FUL'.

screen-active = 0.

ENDIF.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

*********************************************************************

  • For the Drop-Down Listbox

**********************************************************************

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

id = name

values = list

  • EXCEPTIONS

  • ID_ILLEGAL_NAME = 1

  • OTHERS = 2

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

In case you have any further clarifications,do let me know.

Regards,

Puneet Jhari.