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

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.

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

Similar Messages

  • Screen field (MEPO1211-KONNR) not populated user exit ZXM06U43

    Hi Expert,
                      I have to check  Outline agreement (EKKO-KONNR) in the user exit ZXM06U43 when creating or changing PO. one screen field (MEPO1211-KONNR) is provided for that. But value is not populated  into that field(MEPO1211-KONNR) for this user exit ZXM06U43, its always blank. Infact hole structure (MEPO1211) is blank for this exit. 
    So can anybody provide me the screen field name so I can get the value of KONNR in this exit.

    Hi,
    In the user exit - EXIT_SAPMM06E_012, YOU CAN ONLY DO CHECKS/VALIDATIONS;
    you have a paramter I_BSTYP which hold the type of the document(PO/Out Agreement/PR).
    Paramter I_EKKO will hold the data entered on the screen. It will be the incoming data which can be used to validate.
    TO PASS THE DATA, CHECK the below exit:
    EXIT_SAPMM06E_018 : Import Data from Customer Subscreen for Purchasing Document
    EXIT_SAPMM06E_007/EXIT_SAPMM06E_006: Export Data to Customer Subscreen for Purchasing Document Header
    Hope this helps
    Regards
    Shiva

  • Problem in RESETing certain fields in ME22 Upon editing : User EXIT FOR PO

    I am working on an user exit which should reset the order quantity in Me22 if user tries to modify it. Suppose the original qty is 200 KG and user tries to modify it to 100 KG, it should be reset back to 200 KG upon save. I tried user exit EXIT_SAPMM06E_013 and EXIT_SAPMM06E_017. I tried to over write new values of that field with old values. ( Eg. YEKPO-MENGE to XEKPO-MENGE). But still the  PO document is saved with XEKPO-MENGE . Is there any other process overwriting it back or is it losing it scope outside my Include ? Here is my code in EXIT_SAPMM06E_013.
    Also tried putting YEKET-MENGE to XEKET-MENGE. Still did not work. Then i moved to EXIT_SAPMM06E_017. Tried to copy i_ekpo_old-menge to i_ekpo-menge. Still did not help.
    I had similar problem with Sales order too. I figured out that along with YVBAP-KWMENG copy to XVBAP-KWMENG, i had to do YVBEP-CMENG to XVBEP-CMENG and it worked fine.
    *   INCLUDE ZSWI_NOMIT_PO_VALIDATION
       DATA: i_wa_xekpo  TYPE  uekpo,
             i_wa_yekpo  TYPE  uekpo,
             i_oijnomi TYPE  oijnomi.
       DATA: i_wa_yeket  TYPE ueket,
             i_wa_xeket  TYPE eket,
             i_eket      TYPE eket OCCURS 0 .
       DATA :i_tabix TYPE sytabix.
       CONSTANTS: c_char_i VALUE 'I',
                  c_char_e VALUE 'E',
                  c_char_f VALUE 'F',
                  c_char_p VALUE 'P',
                  c_char_v VALUE 'V',
                  c_bulk_order(2) VALUE 'ZB',
                  c_po_change(4)   VALUE 'ME22',
                  c_pon_change(5)  VALUE 'ME22N'.
       IF i_ekko-bstyp = c_char_f     AND    " Purchase orders
          i_ekko-bsart = c_bulk_order AND    " Bulk orders
          sy-batch IS INITIAL         AND    " In foreground
          ( sy-tcode   = c_po_change   OR    " PO Change
            sy-tcode   = c_pon_change   ) .   " Enjoy PO Change
         CLEAR: i_wa_msg .
         REFRESH: i_message .
         LOOP AT xekpo INTO i_wa_xekpo .
           i_tabix = sy-tabix.
           READ TABLE yekpo
                INTO i_wa_yekpo
                WITH KEY ebeln = i_wa_xekpo-ebeln
                         ebelp = i_wa_xekpo-ebelp .
           IF sy-subrc EQ 0 .
             CLEAR: i_oijnomi .
             SELECT SINGLE * FROM oijnomi
               INTO i_oijnomi
              WHERE docnr  = i_wa_xekpo-ebeln
                AND docitm = i_wa_xekpo-ebelp
                AND docind = c_char_p .
             IF sy-subrc EQ 0. " TIED TO A NOMINATION
               IF i_wa_xekpo-menge NE i_wa_yekpo-menge .
                 xekpo-menge = i_wa_yekpo-menge.
                 MODIFY xekpo FROM xekpo INDEX i_tabix
                 TRANSPORTING menge .
                 READ TABLE yeket INTO i_wa_yeket
                            WITH KEY ebeln = i_wa_xekpo-ebeln
                                     ebelp = i_wa_xekpo-ebelp .
                 xeket-menge =  i_wa_yeket-menge.
                 MODIFY xeket FROM xeket INDEX i_tabix
                 TRANSPORTING menge .
               ELSEIF i_wa_xekpo-werks NE i_wa_yekpo-werks .
                 MODIFY xekpo FROM i_wa_yekpo INDEX i_tabix
                 TRANSPORTING werks.
               ENDIF .
             ENDIF .
           ENDIF .
         ENDLOOP .
        ENDIF .

    Hello Shareen,
    You cannot modify any Purchase order fields (Header and Line)with these function exits EXIT_SAPMM06E_XXX in 4.6C. They can  only be used for validations or outbound scenarios such as updating a custom table. Probably in later versions, you may be able to do that. When we had such a requirement, we ended up creating a custom enhancement.
    Thanks,
    Venu

  • Updating custom field in table EKKO within user exit when PO is saved

    I am trying to update a custom field in table EKKO when a PO is saved.  I am using FM EXIT_SAPMM06E_013, within enhancement MM06E005.  Since EKKO is not a table that can be updated with this user exit, I am using a technic that I read about on SDN where I assign a field symbol to the calling program variable and then am able to access data within EKKO table.  But when I pass this data back into the field symbol, for some reason this field is not getting saved when the PO is saved.  In debug mode, it looks like this field is getting updated, but when I look in the table after the PO is saved, it is not there.  My code sample is below.  What I am doing wrong?
    data:
      CHAR(50) VALUE '(SAPLMEPO)EKKO-ZHDRCSTCENTER',
      g_zhdrcstcenter like ekko-zhdrcstcenter,
      FIELD-SYMBOLS <F1> type any.
    if i_ekko-ekorg = '5401'.
      ASSIGN (char) to <F1>.
      g_zhdrcstcenter = <F1>.
      move '0000113322' to g_zhdrcstcenter.
      <F1> = g_zhdrcstcenter.
    endif.
    Thanks!
    Sarah Smyth.

    Firstly, have you investigated using EXIT_SAPMM06E_008 to set any custom fields you have added in the EKKO_CI / CI_EKKODB structure?.. that might work more easily.
    In terms of doing an assign back into a calling program's memory, it can work but it's probably worth setting a break point in your code then stepping through watching the values in EKKO - sometimes you can find subsequent code that re-writes an earlier copy of values back into the structure, thereby preventing you doing your change...  SAP does warn this method is for "internal use".  Also check in your debugger that it's SAPLMEPO and not SAPMM06E you need.

  • How to use a screen-field when applying BADI or User Exit to a T Code

    Hi Experts,
    I need your help on this problem.
    I have created a BADI for the transaction code miro. I have got the Exit name on which the enhancement has to be done. I want to perform a check on a text field (Scrren field name INVFO-SGTXT).
    When my break point occurs i enter INVFO-SGTXT in the field to check the value present in it. But it shows that no such field exists.
    My Basic doubt is how to use a value entered in a text field in a tcode while performing a User Exit or BADI on it.
    Do I have to declare it. If yes please mention how?
    Thanks in advance guys.

    Hi,
    The first question here would be... do you plan on having multiple implementations down the road because if not there really isn't any reason to create a BADI inside the exit.  If that is the case then add the field as an importing parameter in your BADI interface and then you should be able to see it inside the BADI at your break-point.
    Regards,
    Ryan Crosby

  • How to select several values from a user exit variable in a planning folder

    Hello,
    I have created a user exit variable for limiting the values only to which the user need to access.
    For a simulation part, it is then necessary for him to select several values from these values (not only one, and not all)
    But It seems in this case the user has only two possibilities :
    - keep all the values without any restriction
    - restrain the selection to only one value.
    It seems possible for the user to access to a multiple choice window, but this possibility doesn't seems to work : in all tests we did, only the first value was taken into account by BPS.
    If this method is not good do you know an other manner to permit the user to choice several values amongst a set of pre-selected  (because the original set is too important) values ?
    Thanks for your help.

    Hi Mayank,
    Thanks for your response, but I don't think it corresponds to my problem.
    I my case, I use a user exit variable to filter some data. It seems BPS offers the possibility to the user to select several values amongts the pre-selected values presented by the user exit variable, but it doesn't work. We can use a popup in which we enters the required values, but in final, only the first value is taken into account.
    I don't know if it is due to a BPS bug or if it is not a good solution in regard to BPS philosophy. In this case, the concerned caracteristic isn't in the header but in lead columns.
    I must present a solution to my client next monday, so I have not enough time to open an OSS message.
    An alternate solution should be interesting too.
    My need is to present to a user a selection of values amongst all values from an infoobject (the user exit variable seemed to be a good solution) and the user must have the possibility to select some values amongst these as filter.
    Regards

  • Creation of new field with the absense of user exit

    Helllo Abapians,
    For one of the T.Code , i dont find any user exits for that T.code.but one customized field is there to that T.CODE.
    How it is possible???

    hi,
    Plz refer to the program on the link to find the user exit.
    http://www.erpgenie.com/abap/code/abap26.htm
    Regards
    Sumit Agarwal

  • F-53  Doc. No. Fields showing Different from Different User ID

    Dear Experts,
    There have some field related problem in f-53 t code. When I Login from my ID in f-53, selecting doc. no. radio button at Aditional Selection  and enter the it is showing 27 fields, but when I login from another user id then it is showing 20 fields.
    Anybody can tell me where is the problem? There have any configuration on that?
    Sourav

    Dear:
                Please execute SU53 in both users after when you have executed F-53 and see missing line items. There seems a missing authorization for some documents. Please also check the input criteria given by you in F-53 like company code and vendor.
    Regards
    Edited by: Atif Farooq on Jun 4, 2011 8:00 AM

  • How to add a DataBase Field in PLD from a User Defined Table

    Hi All,
    Please tell me how should i add a database field in PLD from User Defined Field...
    The DropDown for tables in the Property window does not shows the User Define tables...How should i see them...
    Thanx in Advance
    Manish

    In PLD choose object Database. Then press Alt + table combobox, this will show the UDT. Then choose the column.

  • Cannot see fields in datasource after creating user exit

    Hi,
    I have created a view from table and then created a generic datasource from this view. aftre that i appended the extract structure with my key figures (3 fileds) and then populated it by user exit. Now i can see that data is being extracted by user exit( in debug mode), but i dont see the fields in the datasource.
    What am i doing wrong,
    Please help.
    Thanks

    Hi Raj,
    In case the previous post did not work check whether you have the entries for the fields (newly added) in the table ROOSFIELD for your datasource.
    You may need to write a small ABAP program to resolve your issue:
    To resolve your poblem you would need to write a small ABAP program:
    tables ROOSFIELD.
    Update ROOSFIELD set SELECTION = 'X' where
    OLTPSOURCE = '<your datasource name>' and
    FIELD = '<field which is hidden/missing>'.
    Execute the program for each of the field and check the entries in RSO2.
    Bye
    Dinesh

  • How to download values of any field having spaces from table ?

    Hi Experts,
    I have one requirement. From table but000, I have to download some values for field name1 based on partner values. The problem is the names are having spaces after it, i need to download completely including extra spaces after name.
    I have searched many threads , but coudnt find any useful information.
    i am just dowloading form edit, download options.
    Regards,
    Gaurav.

    Hello,
    In my opinion, you need to download the data as a text file. Then import it in excel. While importing you can do some settings to keep the spaces, leading zeroes etc.
    Hope this helps,
    Regards,
    Himanshu

  • Populating values of a field based on logged in user

    Hi,
    My requirement is as follows:
    I have a LOV input field. The LOVs for the field should be populated based on the logged in user. Every user will have a group of values associated with him.
    Example:
    USER_ID/NAME BUSINESS_UNIT_ID
    1 B101
    2 B108
    1 B106
    1 B103
    2 B105
    2 B119
    if the logged in user is 1, the LOV field should have values as B101,B106 and B103.
    Can someone help me in implementing this?
    Thanks,
    Ashok

    Hi,
    looks like you have to populate LOV based on logged in user. so make a view object which will return respective values by taking user id as input(bind variable).
    execute the vo after loging.
    ~Abhjit

  • How to set default date value to a field on screen

    How to set default date value to a field on screen and allow users to modify it ....

    Hello,
    In the PAI module, you need to save the changes to the database using the command MODIFY.
    Follow an example:
    Create or change a message in database table T100. If there is no message with the number 100 in the MYMSGCLASS message class in English, it will be created. Otherwise only the text is changed.
    DATA message_wa TYPE t100.
    message_wa-sprsl = 'EN'.
    message_wa-arbgb = 'MYMSGCLASS'.
    message_wa-msgnr =  '100'.
    message_wa-text =  'Some new message ...'.
    MODIFY t100 FROM message_wa.
    Regards.

  • System generated value for a field and incrementing (using module pool pro)

    Hi,
    I'm getting system generated value for a field and incrementing (i.e done by coding) when i'm saving the screen or transaction (which is created using module pool programming) while modifying, saving its working fine, but when i'm going out of the screen or exit n again i start the screen (with some ztransco) the value for the field again starting from 0 so i want to start from the same value for a field where we exit or got out from the screen n incremented respectively while saving the screen,
    Thanks & Regards,
    MS
    Edited by: Rob Burbank on May 4, 2010 10:40 AM

    Search the forum for number range objects.
    Rob

  • MIGO User Exit/BADI to disable field

    Hi,
    I would like to disable a specific set of fields in MIGO (fields under the GOITEM structure). Is there a BADI (or user exit) I can use to implement this functionality ?
    Thanks.

    Hi,
    My understanding is this BADI is used for modifying the value of the field itself. My requirement is to disable the field (user should not be able to edit the value). Whenever I add the LOOP AT SCREEN statement on this BADI, the screen field GOITEM-CHARG is not processed.
    I am actually looking for a BADI/user exit where this screen field can be read.
    Thanks.

Maybe you are looking for