‎2009 Mar 16 7:57 PM
Hi,
I am getting a dump for this report when I call the FM.
Type conflict when calling a function module (field length).
What could be the reason for this.I don't want to use occurs in my table declartions.because I will be using this in a Webdynpro app.
report x.
DATA: doc_header TYPE STANDARD TABLE OF bapidochdrp .
DATA: doc_items TYPE STANDARD TABLE OF bapiskfitm .
DATA: return TYPE STANDARD TABLE OF bapiret2 .
DATA: wa_header TYPE bapidochdrp .
DATA: wa_doc TYPE bapiskfitm .
DATA: wa_return TYPE bapiret2 .
wa_header-co_area = 1000.
wa_header-docdate = sy-datum.
wa_header-username = Sy-UNAME.
APPEND wa_header TO doc_header.
wa_doc-statkeyfig = '2002'.
wa_doc-stat_qty = '2'.
WA_DOC-REC_WBS_EL = '102094005-8505'.
APPEND wa_doc to doc_items .
wa_doc-statkeyfig = '2000'.
wa_doc-stat_qty = '3'.
WA_DOC-REC_WBS_EL = '102094005-1000-01-01-01'.
APPEND wa_doc to doc_items .
wa_doc-statkeyfig = '2000'.
wa_doc-stat_qty = '4'.
WA_DOC-REC_WBS_EL = '102094005-2030-01-01-01'.
APPEND wa_doc to doc_items .
wa_doc-statkeyfig = '2002'.
wa_doc-stat_qty = '5'.
WA_DOC-REC_WBS_EL = '102094005-5000-01-01-01'.
APPEND wa_doc to doc_items .
wa_doc-statkeyfig = '2001'.
wa_doc-stat_qty = '5'.
WA_DOC-REC_WBS_EL = '102094005-3500'.
APPEND wa_doc to doc_items .
CALL FUNCTION 'BAPI_ACC_STAT_KEY_FIG_POST'
EXPORTING
doc_header = doc_header
* IGNORE_WARNINGS = ' '
* IMPORTING
* DOC_NO = DOC_NO
TABLES
doc_items = doc_items
return = return
* CUSTOMER_FIELDS = CUSTOMER_FIELDS
.
COMMIT WORK.
IF sy-subrc IS INITIAL.
READ TABLE return INTO wa_return INDEX 1.
WRITE : wa_return-message.
ENDIF.Rgds
Praveen
‎2009 Mar 16 8:02 PM
In the BAPI, Doc_header is a structure not a table. but you are passing value through a table. Just pass the wa_header instead doc_header.
Kuntal
‎2009 Mar 16 8:02 PM
In the BAPI, Doc_header is a structure not a table. but you are passing value through a table. Just pass the wa_header instead doc_header.
Kuntal
‎2009 Mar 16 8:02 PM
‎2009 Mar 16 8:08 PM
This issue occurs when you function modules parameters are of different type
and the parameters you are passing does not match.
Just Goto->SE37>OPEN-->'BAPI_ACC_STAT_KEY_FIG_POST'
Check the types for doc_header ,doc_items , return
there will be a mismatch.
Just the declare the same types in your program.
CALL FUNCTION 'BAPI_ACC_STAT_KEY_FIG_POST'
EXPORTING
doc_header = *doc_header*
* IGNORE_WARNINGS = ' '
* IMPORTING
* DOC_NO = DOC_NO
TABLES
doc_items = *doc_items*
return = *return*
* CUSTOMER_FIELDS = CUSTOMER_FIELDSRegards,
gurpreet
‎2009 Mar 16 8:12 PM
This works:
REPORT zj_test LINE-SIZE 162.
DATA: doc_header TYPE STANDARD TABLE OF bapidochdrp .
DATA: doc_items TYPE STANDARD TABLE OF bapiskfitm .
DATA: return TYPE STANDARD TABLE OF bapiret2 .
DATA: wa_header TYPE bapidochdrp .
DATA: wa_doc TYPE bapiskfitm .
DATA: wa_return TYPE bapiret2 .
wa_header-co_area = 1000.
wa_header-docdate = sy-datum.
wa_header-username = sy-uname.
APPEND wa_header TO doc_header.
wa_doc-statkeyfig = '002002'.
wa_doc-stat_qty = '00000000000002'.
wa_doc-rec_wbs_el = '0000000000102094005-8505'.
APPEND wa_doc TO doc_items .
CALL FUNCTION 'BAPI_ACC_STAT_KEY_FIG_POST'
EXPORTING
doc_header = wa_header
* IGNORE_WARNINGS = ' '
* IMPORTING
* DOC_NO = DOC_NO
TABLES
doc_items = doc_items
return = return
* CUSTOMER_FIELDS = CUSTOMER_FIELDS
.
COMMIT WORK.
IF sy-subrc IS INITIAL.
READ TABLE return INTO wa_return INDEX 1.
WRITE : wa_return-message.
ENDIF.
‎2009 Mar 16 8:18 PM
Thank you Kuntal.
That's it.I made mistake by passing table to a structure.
rgds
Praveen