2011 Sep 12 9:52 AM
Hi Experts,
i'm tryng to assign the structure bapi_te_mepoheader at extensionin in this way:
MOVE-CORRESPONDING pt_ifile TO s_bapi_te_mepoheader.
pt_extensionin-valuepart1 = s_bapi_te_mepoheader.
pt_extensionin-structure = 'BAPI_TE_MEPOHEADER'.
but it return error: "pt_extensionin-valuepart1 and s_bapi_te_mepoheader are not mutually convertible in a Unicode program" so i tried with a concatenate:
CONCATENATE pt_ifile-ebeln wa_field-zzsaiso wa_field-zzsaisj ..[etc]...INTO valuepart RESPECTING BLANKS.
but the QUAN and CURR data field types give me problems of irregular shifting of fields.
How can i solve this problem?
thanks in advance,
Cosimo.
2011 Sep 12 11:57 AM
The structures for both are not same... check once..
2011 Sep 12 10:04 AM
Hi Cosimo,
Check like this and do for that bapi.
DATA: wa_extensionin TYPE bapiparex,
wa_bape_vbap TYPE bape_vbap,
wa_bape_vbapx TYPE bape_vbapx,
wa_bape_vbak TYPE bape_vbak,
wa_bape_vbakx TYPE bape_vbakx,
lv_posnr TYPE posnr.
Processing the header extension
CLEAR wa_bape_vbak.
wa_bape_vbak-ZZFIELD = 'TEST'.
wa_extensionin-structure = 'BAPE_VBAK'.
wa_extensionin+30(960) = wa_bape_vbak.
append wa_extensionin to lt_extensionin.
clear wa_extensionin.
Processing the line extension
LOOP AT line_items INTO wa_lineitems.
ADD 10 TO lv_posnr.
CLEAR wa_bape_vbap.
wa_bape_vbap-ZZFIELD = 'TET'.
wa_extensionin-structure = 'BAPE_VBAP'.
wa_bape_vbap-posnr = lv_posnr.
wa_extensionin+30(960) = wa_bape_vbap.
append wa_extensionin to lt_extensionin.
clear wa_extensionin.
CLEAR wa_bape_vbapx.
wa_bape_vbapx-ZZFIELD = 'X'.
wa_extensionin-structure = 'BAPE_VBAPX'.
wa_bape_vbapx-posnr = lv_posnr.
wa_extensionin+30(960) = wa_bape_vbapx.
append wa_extensionin to lt_extensionin.
clear wa_extensionin.
ENDLOOP.
Then the call to the BAPI
CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
EXPORTING
order_header_in = ls_order_header_in
order_header_inx = ls_order_header_inx
IMPORTING
salesdocument = lv_salesdocument
TABLES
return = lt_ret2
order_items_in = lt_order_items_in
order_items_inx = lt_order_items_inx
order_partners = lt_order_partners
order_keys = lt_order_keys
extensionin = lt_extensionin.
Note: If you have a need to force a different Business Object type or wish to see the extension return fields then use the function SD_SALESDOCUMENT_CREATE instead.
CALL FUNCTION 'SD_SALESDOCUMENT_CREATE'
EXPORTING
sales_header_in = ls_order_header_in
sales_header_inx = ls_order_header_inx
business_object = 'BUS2032'
IMPORTING
salesdocument_ex = lv_salesdocument
sales_header_out = lv_sales_header_out
sales_header_status = lv_sales_header_status
TABLES
return = lt_ret2
sales_items_in = lt_order_items_in
sales_items_inx = lt_order_items_inx
sales_partners = lt_order_partners
sales_keys = lt_order_keys
extensionin = lt_extensionin
incomplete_log = lt_incomplete_log
extensionex = lt_extensionex.
Check this i did for sales order.
Regards,
Madhu.
Moderator message: copy/pasted from previous discussions, please do not repeat, or your user ID might get deleted!
Edited by: Thomas Zloch on Sep 14, 2011 1:07 PM
Hi Thomas,
Hi,
Actually this code i got from erpgenie.com and i implemented that in my system.If there is any issue related to extension i am giving this code.This is not just copy and paste.I already answered related to extension three to four times.If it wrong giving code then it wont repeat.
Edited by: madhurao123 on Sep 14, 2011 5:03 PM
2011 Sep 12 11:57 AM
2011 Sep 13 8:15 AM
Now it work,
thanks so much for your answers.
Cosimo.
Edited by: Kosimo on Sep 13, 2011 9:15 AM
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |