Application Development and Automation 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: 
Read only

Promblem in BAPI_EXCINV_CREATE_FROMDATA

Former Member
0 Likes
773

Hi,

i have req, to post excess invoice had searched in the forum got the function module to post automatically (BAPI_EXCINV_CREATE_FROMDATA),but not able understand ... please send sample code....

regards,

santosh

Edited by: santosh jajur on Dec 7, 2009 10:29 AM

Edited by: santosh jajur on Dec 7, 2009 10:39 AM

Edited by: santosh jajur on Dec 7, 2009 11:20 AM

Edited by: santosh jajur on Dec 8, 2009 8:55 AM

Hi,

i have req, to post excess invoice had searched in the forum got the function module to post automatically (BAPI_EXCINV_CREATE_FROMDATA),but not able understand ... please send sample code....

regards,

santosh

Edited by: santosh jajur on Dec 7, 2009 10:29 AM

Edited by: santosh jajur on Dec 7, 2009 10:39 AM

Edited by: santosh jajur on Dec 7, 2009 11:20 AM

Edited by: santosh jajur on Dec 8, 2009 8:55 AM

4 REPLIES 4
Read only

former_member206377
Active Contributor
0 Likes
726

code snippet :


 DATA:BEGIN OF obhead.
        INCLUDE STRUCTURE bapi_j_1iexchdr.
        DATA:END OF obhead.

DATA: BEGIN OF errmsg OCCURS 10.
        INCLUDE STRUCTURE bapiret2.
DATA: END OF errmsg.
DATA: BEGIN OF itab OCCURS 100.
        INCLUDE STRUCTURE bapi_j_1iexcdtl.
DATA: END OF itab.

obhead-excise_number = 'INV960/09'.
  obhead-excise_date = sy-datum.
  obhead-reference_doc = '5000001638'.
  obhead-ref_year = '2009'.
  obhead-REF_INDICATOR = 'R'.

CALL FUNCTION 'BAPI_EXCINV_CREATE_FROMDATA'
    EXPORTING
      obj_header   = obhead
      process_flag = 'I'
    TABLES
      obj_item     = itab
      return       = errmsg.
  CLEAR errflag.
  LOOP AT errmsg.
    IF errmsg-type EQ 'E'.
      WRITE:/'Error in function', errmsg-message.
      errflag = 'X'.
    ELSE.
      WRITE:/ errmsg-message.
    ENDIF.
  ENDLOOP.

Read only

0 Likes
726

Hi Vasuki S Patki ,

Thanks for reply and also searched in forum u having same type issues can explain clear how solve this issue and also in my function module does not cantain any source code

can send me the deatails of coding step by step... please.

regards,

santosh

Read only

0 Likes
726

Hi Santosh,

yes, the code is commented in few releases. but, It is available in ECC .

I think it would be better to go for BDC.

Read only

0 Likes
726

Hi Vasuki S Patki,

Can ve copy code form ecc and implent it will creates any promblem ... am not much aware about the functional thing..

regards,

santosh