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: 

Modify a value of a field in dynpro, from a User-Exit

Former Member
0 Kudos

Hi guys, i have a problem and i wish you can help me.

In transaction IW32, I am using EXIT_SAPLCOIH_002 to generate a stock transfer order with BAPI_PO_CREATE1. Once this bapi is used, it gives me the number of the document created.

I need to put this number in the field PMSDO-BSTKD (Customer purchase order number) of the dynpro.

First, i tried to modify directly the database (from table pmsdo), but naturally, the dynpro is not updated and when i save the document, it overwrites with a blank value.

Then I tried to use a field symbol directly to the variable of the program of the dynpro, like this:

FIELD-SYMBOLS: <rv_bstkd> TYPE pmsdo-bstkd.

    ASSIGN ('(SAPLCOI3)PMSDO-BSTKD') TO <rv_bstkd>.
    <rv_bstkd> = ls_return-message_v2.

But its has no effect in the screen.

Lastly, i tried to use two FM C14Z_DYNP_WRITE_FIELD and C14Z_DYNP_READ_FIELD

With the "READ" one, I can read the value on the screen. Then with the "WRITE" one, i can write a new value. (that i can, once again, read it, with the new value!). But when I exit the user exit and return to view the screen, the field is still in blank (or with the previous value).

Any, Ideas? I would be grateful for any suggestions.

Thanks in advance.

5 REPLIES 5

Former Member
0 Kudos

Hi Jguerra,

Please try FM 'IQS1_FILL_WA_FROM_BUFFER'.

Please see a sample code, am not sure about it, but i just give a try.

data: Lv_VIQMEL like VIQMEL.

CALL FUNCTION 'IQS1_FILL_WA_FROM_BUFFER'

EXPORTING

I_QMNUM = CAUFVD_IMP-QMNUM

I_AKTYP = 'V'

IMPORTING

E_VIQMEL = Lv_VIQMEL

EXCEPTIONS

NUMBER_INITIAL = 1

OTHERS = 2.

check sy-subrc = 0.

if Lv_VIQMEL-MSAUS is initial.

move 'X' to NO_RELEASE.

endif.

Regards,

Antony Thomas

Former Member
0 Kudos

Thanks for the answer.

I tried it, i dont know what it does, but seems that doesn't work or something (it gives me a big dump when it tries to load screen 300).

I hear more suggestions!

0 Kudos

Hi,

See aforementioned FM contains almost all tables related to these tcodes.

Dont copy the same code there, instead identify which interface parameter/ table parameter of this FM u need to use and call this FM accordingly.Still am not sure about the result.

Normally for such issues, there will be another exit, where you have to make the update indicator X, so please check with other exit FMs from the same function group( i think Xwo1)

hopes the best

Regards,

Antony Thomas

kesavadas_thekkillath
Active Contributor
0 Kudos

Check whether any badi is available where you can set the screen fileds, i mean for example methods related to PBO or PAI.

pradiptakumar_mishra
Participant
0 Kudos

Hi,

You can try the FM 'DYNP_VALUES_UPDATE'.

Thanks and Regards

Pradipta Kumar Mishra