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

AT SELECTION-SCREEN..........

Former Member
0 Likes
357

Here in one report program I'm having

<b>Parameters: matnr for mara-matnr.

parametere: werks type t001w-werks.</b>

My requirement is " when material is provided, the relevent plant will automatcallu get selected or viewed at the selection screen."

Plz help me solving this problem.

Thanks.

2 REPLIES 2
Read only

naimesh_patel
Active Contributor
0 Likes
338

You can do like this:

at selection-screen.

  • get the werks based on your material into variable l_werks.

  • call this FM to update the field on the screen

   

DATA BEGIN OF LNA_DYNPF OCCURS 1.
INCLUDE STRUCTURE DYNPREAD.
DATA END OF LNA_DYNPF.

    LNA_DYNPF-FIELDNAME  = 'P_WERKS'.   " field name 
    LNA_DYNPF-FIELDVALUE = l_werks.   " value
    APPEND LNA_DYNPF.
 
 
    CALL FUNCTION 'DYNP_VALUES_UPDATE'
         EXPORTING
              DYNAME               = l_cporg        " your program
              DYNUMB               = '1000'  " your screen
         TABLES
              DYNPFIELDS           = LNA_DYNPF
         EXCEPTIONS
              INVALID_ABAPWORKAREA = 1
              INVALID_DYNPROFIELD  = 2
              INVALID_DYNPRONAME   = 3
              INVALID_DYNPRONUMMER = 4
              INVALID_REQUEST      = 5
              NO_FIELDDESCRIPTION  = 6
              UNDEFIND_ERROR       = 7
              OTHERS               = 8.

Regards,

Naimesh Patel

Read only

Former Member
0 Likes
338

Check the below program :

REPORT zz_temp.

tables : marc.

data v_werks like marc-werks.

Parameters: matnr like mara-matnr.

Parameters: werks like t001w-werks.

at selection-screen on matnr.

if not matnr is initial.

select single werks from marc into v_werks

where matnr = matnr.

if sy-subrc eq 0.

werks = v_werks.

endif.

endif.

Thanks

Seshu