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

Help on Dynamic values in select options

Former Member
0 Likes
732

Hi All,

I need help for the following.

1. I have two select options for fields VBAK-VBELN and VBAK-ERDAT one after the other.

2. When I select VBELN through F4 in the first select option then the corresponding ERDAT should be displayed in second select option.

Please let me know how to do this

Hi All,

I need help for the following.

1. I have two select options for fields VBAK-VBELN and VBAK-ERDAT one after the other.

2. When I select VBELN through F4 in the first select option then the corresponding ERDAT should be displayed in second select option.

Please let me know how to do this

4 REPLIES 4
Read only

Former Member
0 Likes
675

Use the FM DYNP_VALUES_UPDATE to update the second value (ERDAT). So basically you use you custom on value-request event on VBELN, and once you get the document number, use the above FM to update the creation date.

Albert

Read only

Former Member
0 Likes
675

hai

tyr this

tables : vbak.

select-options : s_vbeln for vbak-vbeln,

s_erdat for vbak-erdat.

at selection-screen on value-request for s_vbeln-low.

CALL FUNCTION 'DYNP_VALUES_UPDATE'

EXPORTING

dyname = s_vbeln

dynumb = 4

tables

dynpfields = s_erdat

  • EXCEPTIONS

  • INVALID_ABAPWORKAREA = 1

  • INVALID_DYNPROFIELD = 2

  • INVALID_DYNPRONAME = 3

  • INVALID_DYNPRONUMMER = 4

  • INVALID_REQUEST = 5

  • NO_FIELDDESCRIPTION = 6

  • UNDEFIND_ERROR = 7

  • OTHERS = 8

.

IF sy-subrc <> 0.

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

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

ENDIF.

Read only

Former Member
0 Likes
675

Hi,

You are given the vbeln field. In the module

module <mod1>.

it_dynpread-fieldname = 'VBAK-VBELN'.

append it_dynpread.

call function 'dynp_values_read'

read it_dynpread index 1.

v_vbeln = it_dynpread-fieldvalue.

select erdat into itab

from vbak

where vbeln = v_vbeln.

call function 'poup_with_table_display'

export itab

import v_index.

read itab index v_index.

It_dynpread-fieldname = 'VBAK-ERDAT'.

it_dynpread-fieldvalue = itab-erdat.

append it_dynpread.

call function 'dynp_values_update'.

I think this code will help you.

regards,

kamala.

Read only

Former Member
0 Likes
675

Use the below code

tables: pa0000, pa0001.

parameters: p_chk1 as checkbox user-command rusr,

p_chk2 as checkbox user-command rusr,

p_chk3 as checkbox user-command rusr,

p_chk4 as checkbox user-command rusr,

p_chk5 as checkbox user-command rusr.

selection-screen: begin of block blk1 with frame.

select-options: s_pernr for pa0000-pernr modif id ABC,

s_stat2 for pa0000-stat2 modif id DEF,

s_werks for pa0001-werks modif id GHI,

s_persg for pa0001-persg modif id JKL,

s_persk for pa0001-persk modif id MNO.

selection-screen: end of block blk1.

AT SELECTION-SCREEN output.

LOOP AT SCREEN.

IF SCREEN-GROUP1 = 'ABC'.

IF p_chk1 = 'X'.

SCREEN-ACTIVE = 1.

ELSE.

SCREEN-ACTIVE = 0.

ENDIF.

MODIFY SCREEN.

ENDIF.

IF SCREEN-GROUP1 = 'DEF'.

IF p_chk2 = 'X'.

SCREEN-ACTIVE = 1.

ELSE.

SCREEN-ACTIVE = 0.

ENDIF.

MODIFY SCREEN.

ENDIF.

IF SCREEN-GROUP1 = 'GHI'.

IF p_chk3 = 'X'.

SCREEN-ACTIVE = 1.

ELSE.

SCREEN-ACTIVE = 0.

ENDIF.

MODIFY SCREEN.

ENDIF.

IF SCREEN-GROUP1 = 'JKL'.

IF p_chk4 = 'X'.

SCREEN-ACTIVE = 1.

ELSE.

SCREEN-ACTIVE = 0.

ENDIF.

MODIFY SCREEN.

ENDIF.

IF SCREEN-GROUP1 = 'MNO'.

IF p_chk5 = 'X'.

SCREEN-ACTIVE = 1.

ELSE.

SCREEN-ACTIVE = 0.

ENDIF.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

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

*Note

*Titles for check boxes and select options

*P_CHK1 Personal Number

*P_CHK2 Employment Status

*P_CHK3 Personnel Area

*P_CHK4 Employee Group

*P_CHK5 Employee Sub group

*S_PERNR Personal Number

*S_PERSG Employee Group

*S_PERSK Employee Sub group

*S_STAT2 Employment Status

*S_WERKS Personnel Area