Skip to Content
author's profile photo Former Member
Former Member

XREF1_HD becomes blank after going through approval

Hi,

I am populating xref1_hd using substitution during creation of FI document on FV50. I can see the field being populated with the value that I want in BKPF and VBKPF.

After the FI document goes through the approval, the field in BKPF becomes blank.. I have already de-activated BADI FI_HEADER_SUB_1300 because it is taking the screen value which will always be blank.

Any experts please advice. Thank you.

Regards,

Lester

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Sep 26, 2014 at 10:24 AM

    Hi Lester,

    if by approval you mean that the invoice got released and then you use FBV0 to post via batch input, the issue is that the screen used by batch input to post an invoice does not have the fields XREF1_HD and XREF2_HD, so the values got lost.

    You can easily solve the issue with an enhacement in standard include MF05AF00_D0100_POST_APPL_SUB at the end of form d0100_post_appl_sub, similar to this:

    data it_dynp type TABLE OF DYNPREAD WITH HEADER LINE.
    data lv_awkey type awkey.

    if sy-binpt is not initial.
    REFRESH it_dynp.
    it_dynp-fieldname = 'BKPF-AWKEY'.
    APPEND it_dynp.

    CALL FUNCTION 'DYNP_VALUES_READ'
    EXPORTING
    dyname = sy-repid
    dynumb = sy-dynnr
    TABLES
    dynpfields = it_dynp
    EXCEPTIONS
    invalid_abapworkarea = 1
    invalid_dynprofield = 2
    invalid_dynproname = 3
    invalid_dynpronummer = 4
    invalid_request = 5
    no_fielddescription = 6
    invalid_parameter = 7
    undefind_error = 8
    double_conversion = 9
    stepl_not_found = 10
    OTHERS = 11.

    read table it_dynp index 1.
    if sy-subrc eq 0.
    lv_awkey = it_dynp-FIELDVALUE.
    if lv_awkey is not INITIAL.
    select single xref1_hd xref2_hd
    into (bkpf-xref1_hd, bkpf-xref2_hd)
    from bkpf
    where awkey eq lv_awkey.
    endif.
    endif.
    endif.

    Regards,

    Antonio

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.