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: 

Issue with idoc INVOI02

Former Member
0 Kudos
261

Hi All,

I have not worked with ABAP, more into functional area. I am presently working with IDOC INVOIC02. The problem is this idoc is successfully passing in SAP but for few idocs the field BELNR is missing under the segment E1EDK02.

it is not happening with every order, just for few orders. I am not understanding why this value is missing. The Qualifier used here is 009.

Can you please guide?

Regards,

Nisha

5 REPLIES 5

nabheetscn
Active Contributor
0 Kudos
85

Can please explain the process is it an inbound or outbound one...what is this BELNR??

Nabheet

0 Kudos
85

Hi ,

we are creating stock transfer order. after the stock transfer order is created, Goods issue is done from Distribution center to stores. After this Stores recieves the stock and invoicing is done. The idoc INVOIC02 is related to invoices.

The BELNR field contains the accounting document no. But somehow this field is not appearing for few orders . With WE19 i can manually reprocess it again but customer wants to know why this field is not appearing for few orders.

I am not understanding where to look for.

The details are :

direction: 1

basic type: invoic02

msg type: invoic

Regards,

Nisha

0 Kudos
85

I had a look at function IDOC_OUTPUT_INVOIC that creates the INVOIC message type IDoc.

The logic for filling E1ED02-BELNR for qual 009 is simple and it just fills vbdkr-vbeln into the belnr field which is nothing but the invoice number.

SE37 -> IDOC_OUTPUT_INVOIC -> PERFORM FUELLEN_IDOC_INTTAB. -> PERFORM fill_e1edk02.

IF vbdkr-vbeln NE space.
    CLEAR int_edidd.
    CLEAR e1edk02.
    int_edidd-segnam = 'E1EDK02'.
    e1edk02-qualf = '009'.
    PERFORM move_field USING 'E1EDK02-BELNR' vbdkr-vbeln ' '.
    PERFORM move_field USING 'E1EDK02-DATUM' vbdkr-fkdat ' '.
    IF h_rlpos NE space.
      PERFORM move_field USING 'E1EDK02-POSNR' h_rlpos ' '.
    ENDIF.
    MOVE e1edk02 TO int_edidd-sdata.
    APPEND int_edidd.
    PERFORM customer_function.
  ENDIF.

However you can also see there is a PERFORM customer_function. which is a call to user exit custom code that can meddle with this assignment

PERFORM fill_e1edk02. -> PERFORM customer_function. -> CALL CUSTOMER-FUNCTION '002' -> INCLUDE ZXEDFU02.

Look at the coding in the include and you can see if there is some coding meddling with E1EDK02-BELNR value for qualifier 009.

You can paste the coding from ZXEDfU02 if you need any help

0 Kudos
85

Hi,

I am not understanding the exact logic but i could not find any include ZXEDFU02 in the given form. Can you please tell me from where it is picking up the details in belnr field. i looked into the structure table VBDKR for field VBELN. it is actually picking up details from table VBUK where VBELN is outbound delivery no.

The coding in the form is as follows:

FORM customer_function.

sy-subrc = 0.

CALL CUSTOMER-FUNCTION '002'

EXPORTING

xvbdkr = vbdkr

dobject = object

control_record_out = control_record_out

TABLES

xtvbdpr = tvbdpr

int_edidd = int_edidd

xikomv = ikomv

xikomvd = ikomvd

EXCEPTIONS

error_message_received = 1

data_not_relevant_for_sending = 2.

CASE sy-subrc.

WHEN 1.

MESSAGE ID sy-msgid

TYPE sy-msgty

NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4

RAISING error_message_received.

WHEN 2.

MESSAGE ID sy-msgid

TYPE sy-msgty

NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4

RAISING data_not_relevant_for_sending.

ENDCASE.

Regards,

Nisha

0 Kudos
85

Double click on that '002' (in CALL CUSTOMER-FUNCTION '002) and it will open the user exit function that will have INCLUDE ZXEDFU02 and double click on ZXEDFU02. I believe there must be some custom code within ZXEDFU02

Alternatively you can try opening ZXEDFU02 in transaction SE38