‎2007 Dec 28 7:08 AM
Hi Friends,
Can anybody help me . I am facing a problem in IDOC inbound processing.
My scenario in SALES PER RECEIPT - POS like this: I have to read XML (From PC) file and i have to post it.
I am using Idoc - WPUBON01. After reading XML file i used Function module to distribute - MASTER_IDOC_DSTRIBUTE.
In we02 i checked Idoc is generating but status showing 29.
So run the report RSEOUT00. But i am getting message like 'No idoc is selected for processing'.
Plz help me what i have to do. I created port also.
Regards,
P. Kumar.
‎2007 Dec 28 7:13 AM
Hi kumar,
Did you tried using WE19 transaction.There specify your error IDOC number which is posted with the 29 status and try to execute it once again by click on the "Inbound Processing" button. You can debug your function module also by keeping the break point in the FM before going executing the WE19 abd see whether the data is getting populated exactly.
‎2007 Dec 28 7:13 AM
Hi kumar,
Did you tried using WE19 transaction.There specify your error IDOC number which is posted with the 29 status and try to execute it once again by click on the "Inbound Processing" button. You can debug your function module also by keeping the break point in the FM before going executing the WE19 abd see whether the data is getting populated exactly.
‎2007 Dec 28 7:35 AM
Hi Araja,
Yes I did. it is not moving.
Actually i read in sdn if IDoc satatus 29 we need to run RSEOUT00. but when i run this report i am getting 'no idoc is ready for process'.
Plz tel me What i am doing is correct or not.
1) I am reading XML file in to internal table.
2) Passing that data in to Function module. (Master_IDOC_Distribute)
Regards,
Kumar
‎2007 Dec 28 7:48 AM
kumar...
If ur working for INbound
Reading data and passing to internal table is corect.
THEN call a BAPI to post that internal table data to SAP.
(remember passing internal table to Master_IDOC_Distribute IS NOT CORRECT.)
regards,
sarath
‎2007 Dec 28 8:30 AM
Hi Sarath,
Thanks for your information.
Calling BAPI means i needs to develop a bapi or is there any bapi. If you know plz give bapi name. My requirement i needs to post data to SAP IS retail system by using XML file which i can get from PC.
Regards,
Kumar P
Edited by: kumar wf on Dec 28, 2007 2:32 PM
Edited by: kumar wf on Dec 28, 2007 2:33 PM
‎2007 Dec 28 9:18 AM
Hi Kumar,
can u please let me know what is POS system.
r u working in that system? or is it a legasy system?
Even if it is a Legasy sytem You can post that data to that Legasy system if the Bapi is remote enabled.
As of now I don't have that Bapi information.
You may ask your lead. Generally it would be specified in the Func. Spec itself. else. ask your lead.
If I get any inforamtion I will post it.
bye
Sarath
‎2007 Dec 28 9:40 AM
Hi Sarath,
POS means Point of sales.
Actually user will get the XML file from the POS sys. And they will upload that file into SAP Retail system (Normal SAP sys). From that file i needs to read the data and i have to post. Unfortunatly no availability of team lead and functional person .
Presently i read the data in to itab. now i have to post.
I dont know how to do this.
Thanks for reply,
Regards,
Kumar P
‎2007 Dec 28 9:49 AM
Hi,
sarath has told valid point..don't use master_idoc_distribute,instead use the bapi
bapi_idoc_input1..
plz check the sample code how to do with inbound idoc,as u have got the data ,u just need to call the bapi and post it..
check the code and proceed..
FUNCTION zdtsint052f_gpoms_to_sap_gm.
*"----
""Local interface:
*" IMPORTING
*" VALUE(INPUT_METHOD) LIKE BDWFAP_PAR-INPUTMETHD
*" VALUE(MASS_PROCESSING) LIKE BDWFAP_PAR-MASS_PROC
*" EXPORTING
*" VALUE(WORKFLOW_RESULT) LIKE BDWF_PARAM-RESULT
*" VALUE(APPLICATION_VARIABLE) LIKE BDWF_PARAM-APPL_VAR
*" VALUE(IN_UPDATE_TASK) LIKE BDWFAP_PAR-UPDATETASK
*" VALUE(CALL_TRANSACTION_DONE) LIKE BDWFAP_PAR-CALLTRANS
*" TABLES
*" IDOC_CONTRL STRUCTURE EDIDC
*" IDOC_DATA STRUCTURE EDIDD
*" IDOC_STATUS STRUCTURE BDIDOCSTAT
*" RETURN_VARIABLES STRUCTURE BDWFRETVAR
*" SERIALIZATION_INFO STRUCTURE BDI_SER
*" EXCEPTIONS
*" WRONG_FUNCTION_CALLED
*"----
Purpose :On recording the material consumption from *
manufacturing tickets in GPOMS system, GPOMS *
will report the data to the SAP system.Based *
on this message, goods issue to the process order*
will be posted in SAP. This interface will *
used for storage location managed materials *
in SAP. *
Program Logic :Loop at the data records of IDOC and to get the *
Order number and SAP Movement type *
If the Material document already exists for this *
Order number and Movement type then give error *
else call standard FM 'BAPI_IDOC_INPUT1' to *
Material Documents in SAP. *
************************************************************************
Declaration of Constants *
************************************************************************
CONSTANTS :lc_item_create(25) TYPE c VALUE 'E1BP2017_GM_ITEM_CREATE',
lc_mbgmcr(6) TYPE c VALUE 'MBGMCR'.
************************************************************************
Declaration of Variables *
***********************************************************************
DATA : lv_index TYPE sytabix,
lv_retcode type sy-subrc.
************************************************************************
Declaration of Workareas *
************************************************************************
DATA: lwa_e1bp2017_gm_item_create TYPE e1bp2017_gm_item_create,
lwa_data TYPE edidd, " Work area for IDOC
lwa_control TYPE edidc. " Work Area for control rec
Read the control data information of idoc.
loop at idoc_contrl INTO lwa_control Where mestyp = lc_mbgmcr.
Extract the data from the segments.
LOOP AT idoc_data INTO lwa_data
WHERE docnum = lwa_control-docnum and
segnam = lc_item_create.
*->> Set the tabix of the internal table
lv_index = sy-tabix.
Move the Material Document Item Segment data
MOVE lwa_data-sdata TO lwa_e1bp2017_gm_item_create.
Modify the material document item data internal table
PERFORM sub_modify_idocdata changing lwa_e1bp2017_gm_item_create.
*->> set the changed values to the IDOC SDATA
MOVE lwa_e1bp2017_gm_item_create TO lwa_data-sdata.
*->> Modify the table
MODIFY idoc_data FROM lwa_data index lv_index.
Clear the Work areas
CLEAR : lwa_data,
lwa_e1bp2017_gm_item_create.
ENDLOOP. "LOOP AT t_idoc_data
Call the BAPI function module to create the
appropriate Material Document
CALL FUNCTION 'BAPI_IDOC_INPUT1'
EXPORTING
input_method = input_method
mass_processing = mass_processing
IMPORTING
workflow_result = workflow_result
application_variable = application_variable
in_update_task = in_update_task
call_transaction_done = call_transaction_done
TABLES
idoc_contrl = idoc_contrl
idoc_data = idoc_data
idoc_status = idoc_status
return_variables = return_variables
serialization_info = serialization_info
EXCEPTIONS
wrong_function_called = 1
OTHERS = 2.
IF sy-subrc = 1.
RAISE wrong_function_called.
ENDIF.
endloop.
ENDFUNCTION.
----
***INCLUDE LZDTSINT052F_GPOMS_GMF01 .
----
&----
*& Form sub_modify_idocdata
&----
Modify the material document item data internal table
----
FORM sub_modify_idocdata
CHANGING pwa_e1bp2017_gm_item_create TYPE e1bp2017_gm_item_create.
contant declaration
CONSTANTS: lc_261(3) TYPE c VALUE '261'.
DATA : lv_aplzl LIKE resb-aplzl,
lv_aufpl LIKE resb-aufpl,
lv_subrc LIKE sy-subrc,
lv_charg LIKE resb-charg,
lv_uom LIKE pwa_e1bp2017_gm_item_create-entry_uom.
CLEAR: pwa_e1bp2017_gm_item_create-reserv_no,
pwa_e1bp2017_gm_item_create-res_item.
*->> Get SAP storage bin & Storage type from the Z table
SELECT lgtyp lgpla
INTO (pwa_e1bp2017_gm_item_create-stge_type,
pwa_e1bp2017_gm_item_create-stge_bin)
UP TO 1 ROWS
FROM zdtsint050_sttyp
WHERE zstorage_typ = pwa_e1bp2017_gm_item_create-stge_type
AND zstorage_bin = pwa_e1bp2017_gm_item_create-stge_bin.
ENDSELECT.
IF sy-subrc NE 0.
CLEAR: pwa_e1bp2017_gm_item_create-stge_type,
pwa_e1bp2017_gm_item_create-stge_bin.
ENDIF.
PERFORM get_oper CHANGING pwa_e1bp2017_gm_item_create.
Get the Reservation number and Reservation item number
basing on the idoc data.
SELECT rspos werks lgort
INTO (pwa_e1bp2017_gm_item_create-res_item,
pwa_e1bp2017_gm_item_create-plant,
pwa_e1bp2017_gm_item_create-stge_loc)
FROM resb
UP TO 1 ROWS
WHERE rsnum = pwa_e1bp2017_gm_item_create-reserv_no
AND matnr = pwa_e1bp2017_gm_item_create-material
AND charg = pwa_e1bp2017_gm_item_create-batch
AND aufnr = pwa_e1bp2017_gm_item_create-orderid
AND vornr = pwa_e1bp2017_gm_item_create-activity
AND bwart = lc_261.
ENDSELECT.
IF sy-subrc <> 0.
Start of insertion for R31K993797
CLEAR lv_charg.
SELECT rspos werks lgort
INTO (pwa_e1bp2017_gm_item_create-res_item,
pwa_e1bp2017_gm_item_create-plant,
pwa_e1bp2017_gm_item_create-stge_loc)
FROM resb
UP TO 1 ROWS
WHERE rsnum = pwa_e1bp2017_gm_item_create-reserv_no
AND matnr = pwa_e1bp2017_gm_item_create-material
AND charg = lv_charg
AND aufnr = pwa_e1bp2017_gm_item_create-orderid
AND vornr = pwa_e1bp2017_gm_item_create-activity
AND ( splkz = 'X' or
splkz = space )
AND bwart = lc_261.
ENDSELECT.
IF sy-subrc <> 0.
End of insertion for R31K993797
SELECT SINGLE werks lgort
INTO (pwa_e1bp2017_gm_item_create-plant,
pwa_e1bp2017_gm_item_create-stge_loc)
FROM resb
WHERE rsnum = pwa_e1bp2017_gm_item_create-reserv_no.
CLEAR : pwa_e1bp2017_gm_item_create-reserv_no,
pwa_e1bp2017_gm_item_create-res_item.
ENDIF.
ENDIF.
get SAP UOM
SELECT SINGLE zsap_uom
INTO lv_uom
FROM zca_uom_conv
WHERE zext_uom = pwa_e1bp2017_gm_item_create-entry_uom.
IF sy-subrc = 0.
pwa_e1bp2017_gm_item_create-entry_uom = lv_uom.
ENDIF.
ENDFORM. " sub_modify_idocdata
&----
*& Form get_oper
&----
Get the operation
----
<--P_PWA_E1BP2017_GM_ITEM_CREATE_RE Segment
----
FORM get_oper CHANGING p_pwa_e1bp2017_gm_item_create TYPE
e1bp2017_gm_item_create.
DATA : l_aufpl LIKE afko-aufpl,
l_aplzl LIKE afvc-aplzl.
REFRESH : i_op.
UNPACK p_pwa_e1bp2017_gm_item_create-orderid TO
p_pwa_e1bp2017_gm_item_create-orderid.
Get the reservation and routing number for the order
SELECT SINGLE
rsnum
aufpl
FROM afko
INTO (p_pwa_e1bp2017_gm_item_create-reserv_no,
l_aufpl)
WHERE aufnr = p_pwa_e1bp2017_gm_item_create-orderid.
IF sy-subrc = 0.
CALL FUNCTION 'CONVERSION_EXIT_NUMCV_INPUT'
EXPORTING
input = p_pwa_e1bp2017_gm_item_create-activity
IMPORTING
output = p_pwa_e1bp2017_gm_item_create-activity.
ENDIF.
ENDFORM. " get_oper
i have modifeid the incoming data,in ur case its not needed ,only first few lines until the bapi u have to see..if u have any query let me know..
Regards,
Nagaraj
‎2007 Dec 28 7:28 AM
Hi Kumar,
The FM 'MASTER_IDOC_DSTRIBUTE.' will b used in out bound process. where you may get error status message till 48-49. Remaining Status messages will come under INbound Process.
If u want 2 take from records/data to SAP . U need to code a FM, where in u need use BDC/Some Bapi/ or some other process to Update data to SAP.
More over,
RSEOUT00. , and FM MASTER_IDOC_DSTRIBUTE.will come into picture in OUT bound process.
Please check the partner profile details first, then make correction in ur code a required.
Hope I have replyed for ur question.
‎2007 Dec 28 9:54 AM
Hi Kumar,
Maintain the message type with BD64 Customer distribution model and the execute it will work.
Thanks,
Surya
‎2007 Dec 28 10:14 AM
Thanks Nagraj and Surya,
Nag : I will implement your suggestion.
Regards,
Kumar
‎2008 Mar 26 8:23 AM