Skip to Content
author's profile photo
Former Member

Memory Refresh & Field symbol behaviour


My issue was to make address number, city & postal code mandatory while creating PO in Delivery Address.

I used the exit ZXM06U032 & Badi ME_PROCESS_PO_CUST->CHECK method to implement the changes. The changes were working fine & after moving to production system we are facing issues like the error is thrown unnecessarily to update city, Postal code & address number when we are in any other tab instead of Delivery address tab. If we enter into Delivery address tab the error goes off. Other issue is in lower systems like quality, development & proto systems the required error is not thrown for the first time when we create the PO but it does when we exit from the transaction & try creating the PO again.

We have used Field symbol & export/import of memory among these User EXit & BADI. Please help us to fix this.

We are reaching out to you is because the above explained scenarios are caused only for some PO's, for some PO's the error is thrown in the first attempt itself while creating PO. These two test data do not vary in functionality. This is the confusion as to why the issue is only for some PO's not for all. If you need more info regarding the code please do let me know. Else please suggest to rectify.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • author's profile photo
    Former Member
    Posted on Aug 30, 2011 at 12:49 PM


    As you have mentioned, I think it is related to Memory and field symbol unassign.

    Please refresh the memory and also unassign the field symbol once the operation is over. Sometimes Assign statement in field symbol generates dump also.

    Please also check the types of vendor and the details for which you are getting the error


    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Aug 30, 2011 at 02:19 PM

    hi, refreshing the field symbol & memory is done. But even then i am facing the same issue. Problem i encountered is field symbol does not get the value when it is in any other tab apart from Delivery Address. So we are getting the error unnecessarily even though the address exist.

    Another issue is first time when we create the PO by removing city/pc/adrnr no error is displayed. After we come out of the tcode & try the same again we get error. In some cases how may ever times we try we don't get the error.

    The code in BADI as a part of CHECK method is as follows:

    CONSTANTS: lc_nb(4) TYPE c VALUE 'NB',

    lc_f TYPE c VALUE 'F',

    lc_flag TYPE ysd_flags_flagn VALUE 'POITEM_ADDR_MANDT',

    lc_aufnr(5) TYPE c VALUE 'AUFNR'.

    DATA: ls_addr2_data TYPE addr1_data.

    DATA: lt_po_item1 TYPE purchase_order_items,

    ls_po_item1 TYPE purchase_order_item,

    ls_item1 TYPE mepoitem.

    DATA: lv_active1 TYPE customer_activation.

    DATA: lv_aufnr TYPE aufnr.

    DATA: lv_adrc(28) TYPE c VALUE '(SAPLSZA1)ADDR1_DATA'.

    FIELD-SYMBOLS : <ls_addr1_data> TYPE ANY.

    IMPORT lv_aufnr TO lv_aufnr FROM MEMORY ID lc_aufnr.

    IF ls_data-bsart = lc_nb AND lv_aufnr <> space.

    ASSIGN (lv_adrc) TO <ls_addr1_data>.

    IF sy-subrc = 0.

    ls_addr2_data = <ls_addr1_data>.


    IF ls_addr2_data-city1 = space.

    MESSAGE e001(z9) WITH text-003.


    IF ls_addr2_data-post_code1 = space.

    MESSAGE e001(z9) WITH text-002.


    CALL METHOD im_header->get_items


    re_items = lt_po_item1.

    LOOP AT lt_po_item1 INTO ls_po_item1.

    ls_item1 = ls_po_item1-item->get_data( ).

    IF ls_item1-adrn2 IS INITIAL AND ls_item1-knttp = lc_f.



    iv_werks = ls_item1-werks

    iv_flagn = lc_flag

    iv_no_buffer = lc_x


    ov_active = lv_active1


    invalid_input = 1

    no_entry = 2

    OTHERS = 3.

    IF sy-subrc = 0.

    IF lv_active1 = lc_x.

    CLEAR lv_active1.

    MESSAGE e001(z9) WITH text-001 space ls_item1-ebelp.





    FREE MEMORY ID lc_aufnr.

    CLEAR <ls_addr1_data>.


    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member


      From what I understand, the code works in all other environments except for Production.

      Check SMLG in production for the number of instances.

      If in case of multiple instances, EXPORT/IMPORT to memory doesn't work efficiently.

      There could be a possibility, where the data is exported to one instance and

      imported back from a different instance.

      You could try using the EXPORT/IMPORT to Database or try the Function Group/Modules approach.


  • author's profile photo
    Former Member
    Posted on Aug 30, 2011 at 05:21 PM

    Hi Rekha,

    FREE MEMORY ID lc_aufnr.

    CLEAR <ls_addr1_data>.----

    > Comment this line


    Don't clear the field symbol. It will clear the global structure ADDR1_data (i.e. what ever variable you assigned to that field symbols)..



    Add comment
    10|10000 characters needed characters exceeded