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

Reg selection screen

Former Member
0 Likes
401

Hi All,

I have a requirment this I have two fields on the selection screen Plant(WERKS) and storage location(LGORT).If plant value entered on the selection screen the storage location field on the selection should have only storage locations corresponding to the plant selected above(I have to enhance the F4 functionality for lgort field that means it should allow to user to take only the storage locations related to the plant entered)

How can I achieve this at selection scree event I think i have to handle this but how exactly to do this?

Can some body throw some idea on this please

Thanks&Regards

Mahesh

2 REPLIES 2
Read only

anversha_s
Active Contributor
0 Likes
371

HI,

you have to use dynamic F4 help.

chk this sample.

data: begin of itab occurs 0,
matnr like mara-matnr,
end of itab.

data : begin of btab occurs 0,
maktx like makt-maktx,
end of btab.

data mak like makt-maktx.

DATA : return like ddshretval occurs 0 with header line.

data: begin of dynpfields occurs 0.
include structure dynpread.
data: end of dynpfields.

parameters: p_matnr like mara-matnr,
p_maktx like makt-maktx.

Initialization.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_matnr.

REFRESH ITAB.

SELECT matnr FROM mara INTO TABLE ITAB.

call function 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'MATNR '
dynprofield = 'P_MATNR '
dynpprog = sy-REPID
dynpnr = sy-dynnr
value_org = 'S'
TABLES
value_tab = ITAB
return_tab = return.

select single maktx from makt into mak where matnr = return-fieldval.

p_matnr = return-fieldval.

refresh return.
clear return.

move 'P_MAKTX' to dynpfields-fieldname.
move mak to dynpfields-fieldvalue.
append dynpfields.


CALL FUNCTION 'DYNP_VALUES_UPDATE'
    EXPORTING
      dyname               = sy-cprog
      dynumb               = sy-dynnr
    TABLES
      dynpfields           = dynpfields
    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.

refresh return.
clear return.

rgds

Anver

Read only

Former Member
0 Likes
371

write a select statment to drag those lgort details related to the entered werks in

at selection-screen on value-request for g_lgort.

use fm F4IF_INT_TABLE_VALUE_REQUEST.

santhosh