2008 Jul 11 9:54 AM
Hello Experts,
We are having a table type as import parameter, where in we can send multiple rows as input to the BAPI, I need to read the entries and extract data related to them from R/3 Data base.
Ex: Multiple material as input and export as 3-4 fields from MARA table.
Please help with a simple code....
Thanks,
Suma
2008 Jul 11 9:58 AM
please clear ur doubt .......
its not clear .......like what i understood is u need to send multiple entries to bapi as import parameters and need to get data .....
if so take an internal table
write select quiry
and append individula line items to that table and pass that internal table to the import parameters ....
if u explain what exactly u want ....we can help..
please clear ur doubt .......
its not clear .......like what i understood is u need to send multiple entries to bapi as import parameters and need to get data .....
if so take an internal table
write select quiry
and append individula line items to that table and pass that internal table to the import parameters ....
if u explain what exactly u want ....we can help..
2008 Jul 11 9:58 AM
please clear ur doubt .......
its not clear .......like what i understood is u need to send multiple entries to bapi as import parameters and need to get data .....
if so take an internal table
write select quiry
and append individula line items to that table and pass that internal table to the import parameters ....
if u explain what exactly u want ....we can help..
2008 Jul 11 10:22 AM
Hello Shailaja,
Sorry, if my question is not clear.
Our client wants a BAPI which has Table Type in Import Parameter, in the table there will be a structure assigned to it. At run time we need to get the multiple entries from the Import parameter and read data from database and send them out using Export parameter.
We can define a Table type and associated Structure in SE11, and use the same as Associated type in Import parameter.
Ex: MATNR as import parameter(Multiple)
Export 3-4 fields from MARA table will be ok.
so I need a code reading the entries in table type and fetch related data from MARA table.
I think its more clear now.
Thanks,
Suma
2008 Jul 11 11:15 AM
Hi,
DATA: WA_IMPORT TYPE LINE OF <ImportTable>.
LOOP AT <ImportTable> INTO WA_IMPORT.
SELECT SINGLE MATNR MTART MAKTL FROM MARA
INTO EXPORT_TABLE
WHERE matnr EQ wa_import-matnr.
IF sy-subrc EQ 0.
APPEND EXPORT_TABLE.
Endif.
ENDLOOP.
2008 Jul 15 7:31 AM
Hello Alpesh,
With reference to the code you have provided i have changed it but still getting errors, can you please look into my code and fix it?
ZBAPI_TABLETYPE has MATNR in it, as import.
ZBAPI_OUTPUT has MATNR,MTART in it as export.
FUNCTION ZBAPI_TABLEIMPORT.
*"----
""Local Interface:
*" IMPORTING
*" VALUE(IMPORT) TYPE ZBAPI_TABLETYPE OPTIONAL
*" EXPORTING
*" VALUE(OUTPUT) TYPE ZBAPI_OUTPUT
*" VALUE(RETURN) TYPE BAPIRETURN
*"----
DATA: WA_IMPORT TYPE LINE OF ZBAPI_TABLETYPE.
LOOP AT IMPORT INTO WA_IMPORT.
SELECT SINGLE MATNR MTART FROM MARA
INTO OUTPUT
WHERE matnr EQ wa_import-matnr.
IF sy-subrc EQ 0.
APPEND IMPORT.
Endif.
ENDLOOP.
ENDFUNCTION.
Error: OUTPUT is not an internal table the occurs N specification is missing.
Thanks in Advance,
Suma
2008 Jul 11 9:59 AM
Hi Suma
This link gives you the step by step process
http://abaplovers.blogspot.com/2008/02/bapi-sales-order-create-code.html
Regards
Divya
2008 Jul 11 11:22 AM
hi use this..
selection-screen :s_werks for WSRP_RANGESWERKS .
2008 Aug 11 8:37 AM
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |