Stop idocs from creation
hi all,
first of all let me tell you whats happenning presently with the system:
on changing the final invoice flag in PO,the output types ZNE3 is detemined by nace config which results in creation of the idoc which are finally used to send across the other system.
So,the requirement is whenever the final invoice flag in a PO is changed,the idoc should not get created at all.
i know,our goal is stop the entries to be created in NAST table since that only detemines the idoc types processing later.
Please give me suggestions on how to proceed on this?
Regards
Hi,
all config can be done from transaction NACE. Check [SAP documentation|http://help.sap.com/saphelp_di471/helpdata/EN/c8/19878343b111d1896f0000e8322d00/frameset.htm] for more info.
Cheers
Similar Messages
-
Is it possible to filter/stop idocs from going out of SAP based on some IDOC field value?
Does distribution model help in doing that?If it is not going to be sent out, do you even want to create the IDoc? Check for the last user exit available in the processing function module of the IDoc and check the values in there and create a status record 51, if your conditions are met. Then that IDoc will not be transmitted.
-
How to trigger an Idoc from Sales order creation and change
We are trying to trigger Idoc from sales order creation and change we have done following setting mentioned below:
Follow the below steps:
1. Go to NACE transaction
2. Select V1 application and select OUTPUT TYPES
3. Select the required output type and double click on Processing routines.
4. Enter Medium as DISTRIBUTION ALE, Program as RSNASTED and Routine as ALE_PROCESSING.
5. Save it.
message type ORDERSP in the distribution model (BD64).
Follow the below steps to configure the condition records:
1. Go to NACE
2. Select V1 application and select CONDITION RECORDS
3. Select the requred output type and click on Condition records
4. Selection screen will be displayed.
5. Go for execution. In that screen enter the selection criteria. For eg Condition record is based on Sales document type. Then
Sales doc type = OR
Funt = SP
Partner = blank. It means there is no restriction on partner numbers.
Medium = A
date/time = 4
Lan = EN.
Note: partner is left blank means, the sales order of type OR can be send to all partners.
6. Save it.
We also done ALE configuration.
We are facing problem that from VA02 "No output has been selected for printing Message no. V1102"
Kindly suggest the solution.
Regards,
Sharad DixitHi ,
Please check the total error description and diagnosis as below :
InVa02 enter SO go to extras->output->Header->edit.You can find a table with all the triggered output types. Choose the output type BA00 with medium Distribution ALE and go for 'Processing log'. It will show you the error description.
Please paste the diagnosis .
Thanks and Regards,
P.Bharadwaj -
Stop generation of Inbound IDOC from Non - SAP
Hi Experts,
I have a requirement to update data base PA0105 for Email. The Email is coming for external system (Non SAP), which contains 1 employee in 1 IDoc. If SAP has valid email and same has been passed for external system to SAP via Inbound IDoc, it should not update PA0105. Hence, I am deleting the IDOC segments in Exit "ZXHALU07", before RBDAPP01 is getting called. As per the requirement its working fine.
Question: Is there any way to stop generating the IDOC. If the email ID were same, then IDoc should not generate in SAP. Please provide your valuable reply. Thanks.
Regards,
Ganesh R K.Hi All,
Scenario:
Need to Create Inbound IDOC in SAP system and receive it from Non Sap system.
Problem:
IDOC is successfully dispatched from Non Sap system(Sender Side) but, it is not received to SAP system(Receiver Side).
At receiver side(in SAP system) all configuration settings are fine (RFC destination is tested with no errors, partner profile are given with the inbound parameters, function module is successfully tested with no errors, distribution model is created etc).
In receiving system(SAP) no IDOCs are generated in We02 after sending the IDOC from Non Sap side.
Can any one please suggest me the reason for the above mentioned problem?
Thank you,
Swetha.C -
How to stop an idoc from being processed further
Hi Experts,
I have a requirement where i have to stop the idoc from being processed in an user exit.
I have to stop the idoc and give a suitable status message over there.
It would be highly helpful if anybody tells me how to stop the idoc abruptly and giv the status messsage.
Thanks in advance.
Praveen.Hi,
Check the below link
https://forums.sdn.sap.com/click.jspa?searchID=11810720&messageID=3032674
You need to find aproper EXIT.
The avaliable options for you in the exit is
IDOC_DATA
Now if i pick the segment having shiped qty from the data record and check the same with the delivery qty your objective is half done.
When the condition fails you need to update the IDOC with Error 51 saying that this is not possible .
for that you need to bring your logic as
LOOP AT IDOC_CONTROL.
PERFORM LOGIC...
ENDLOOP.
FOR LOGIC .
All the criteria and then update the status of the IDOC then error is generated and updated to the IDOc.
PERFORM updatestatusidoc.
endform logic.
like this in
form updatestatusidoc.
IF subrc = 0 .
t_idoc_status-docnum = f_idoc_contrl-docnum.
t_idoc_status-status = c_idoc_status_ok.
t_idoc_status-msgty = 'S'. -
>denotes success
t_idoc_status-msgid = 'ZXXX'.
t_idoc_status-msgno = '000'. "
t_idoc_status-msgv1 = itab-field.
APPEND t_idoc_status.
ELSEIF subrc = 1.
t_idoc_status-docnum = f_idoc_contrl-docnum.
t_idoc_status-status = c_idoc_status_error.
t_idoc_status-msgty = 'E'. "denotes --->error
t_idoc_status-msgid = 'ZXXX'.
t_idoc_status-msgno = '001'. "
t_idoc_status-msgv1 = itab-field.
APPEND t_idoc_status.
endif.
endform.
this has to be done to make the idoc to trigger error mode.
Regards,
Raj. -
Creation of Idocs from the change pointers by the program RBDMIDOC
Hello,
I'm Creating Idocs from the change pointers by the program RBDMIDOC.
The IDOCS Created using the message type HRMD_A are Correct but when i try to RUN RBDMIDOC for message type HRMD_B no Data is selected for distribution.
All the customizing are similar and i presume that all the change pointers are active (BD50 and IMG->Personnel Management -> Organizational Management -> Basic Settings -> Activate change documents).
Can anyone help me with the necessary steps to create this IDOC types.
Do anyone know if the RBDMIDOC report is the Same for messages HRMD_A and HRMD_B.
Thanks in Advance,
Pedro FerreiraIf the setting is fine, there may be some code in exit or badi for program RBMIDOC. Check the Exit and BADI.
check the exit EXIT_SAPLBD11_001 and
check the badi IDOC_CREATION_CHECK.
Probably there may be some code on these exits which are stoping your code from getting generated.These are the two trigger happen once u execute the RBMIDOC program.for HR, we use RHALEINI program to generate the idoc. but even RBDMIDOC works. These 2 triggere will come with RHALEINI also.
If there is no code here, Then there is problem in the setting only. -
Sending Order Number via IDOC upon creation of Sales Order
Hi Experts,
I have a requirement where i receive an order from an external system to SAP as an IDOC.
Upon arrival, i have to create the Order in SAP and send the Order Number back to the external system in the form of IDOC.
How can i accomplish this? Kindly share your expertise on this with me.
Thanks in advance.
Regards,
KeerthiHi Gary,
Now when the Order is posted in SAP, i need a method which will automatically trigger the Outbound IDOC from SAP rather than me doing so manually.
Is there a way i can track the creation of the Order in SAP and somehow configure SAP to trigger the Outbound IDOC with the Order number automatically?
Thanks in advance,
Keerthi -
Procedure for Mapping two types of Idocs from RFC function Module
Hi
My Scenario is RFC -- XI -- IDOC
Here i have 2 custom Idocs
First IDOC for Creation
second is for Deletion/Changing
Based on the condition from RFC it should trigger either one of the IDOC above.
Please provide me the procedure to do in IR and ID..
Regards,
Yeswanth.YeswanthRaj:
I found your conflicted statements
The following statement you say you just have one receiver, to receive two IDOCs
But i have only one receiver where the 2 IDOcs needs to be send based on the condition..
The following statements showing that you have more than one receiver,
the condition editor for receiver determination usually used for multiple receivers based on XPATH or Context Object condition
It is mapped based on the condition that is given in Receiver Determination and i has two interface Determinations.
It seems that the first scenario is your situation.
If your answer is yes, and your source interface is just one,and target interface is two (two IDOC), then this should be typical
muti-mapping scenario, and the propose I gave to you should fit
Regards.
Liang -
Payment advice IDOC from payment run
Hello,
Can anyone please let me know the configuration steps required for generating an IDOC from the payment run?
Thanks.
ShilpaDear Shilpa,
The following are the steps for F110- IDOC:
For outbound IDOC:
Creation of z segment type (if required)
Create a new Extension IDoc object (if required)
Assign the message type (PAYEXT) with the basic IDoc type (PEXR2002) and Extended IDoc type (If any)
Create project under the transaction CMOD for enhancement FEDI0004.
Component EXIT_SAPLIEDP_902 of Enhancement FEDI0004-used to populate the values for the ZSEGMENT fields.
Coding for exit
For inbound IDOC:
Create of Z segment type (if required)
Create a new Basic IDoc type (if required)
create a new message type (if required)
Assign the message type with the IDoc type
HOUSE BANK CONFIGURATION:
Updating Partner Profile
Maintain Outbound parameters
Maintain Inbound parameters
EDI Compatible payment methods
Changes in APP config (in FBZP):
Changes in 'Paying Company codes'- Form
Changes in 'Payment method Country' - Payment method E - NEFT (inclusion of payment medium program RFFOEDI1)
Changes in 'Payment method co code'- Form
Changed in Vendor Master:
Updation of Bank details in it.
Regards,
Kiran -
Want to transfer data via idocs from one R/3 to different R/3
Hi!!
May i hav nay step by step pdf which gives the complete flow of how to transfer idocs from from one R/3 to different R/3.
Though i have the basics steps but some where I m stuck.
Also I have two doubts::
1.Is thr Any relation bw port name and Logical System name?Can they be same.??I hav kept Logical System name as SAPE60 AND PORT name also as SAPE60(in e60) and SAPEI6(in ei6) servers respectively.
2.Should the Logical System names be maintained same in both the servers??
Kindly respond .
Helpful answers will be rewarded points!!!Hi Deepika ,
See the Example scenarios
MASTER DATA TRANSFERMATION BETWEEN 2 DIFF CLIENTS
For this scenario Client 800 is the Sender and 810 is the receiving system
1. Creating Logical Systems
o Login using 800 client
o Go to T. Code SALE
o Expand Sending and Receiving Systems
o Expand Logical Systems
o Click on Define Logical System
o Click on New Entries
o Create STUD_S, STUD_R Logical Systems
o Save and come back
o Assign the STUD_S Logical System to client 800
o Assign the STUD_R Logical System to client 810
2. Creating the RFCs
o Go to T. Code SM59
o Expand R/3 Connections
o Enter RFC Name as STUD_S
o Connection Type as 3
o Language as EN
o Client as 800
o User as SAPUSER
o PWD as abap
o Target host as sap
o Click on Remote logon button to test the RFC
o Enter RFC Name as STUD_R
o Connection Type as 3
o Language as EN
o Client as 800
o User as SATISH
o PWD as abap
o Target host as sap
o Click on Remote logon button to test the RFC
3. Creating the Message Type
o Go to T. Code WE81
o Click on change, continue
o Click on New Entries button
o Give message type as ZBAPI_STUD_MAS and description
o Save and back
4. Creating the Segment
o Go to T. Code WE31
o Give segment name as ZBAPI_STUD_SEG
o Enter Short Text
o Enter the Field Name and Data Element in the text boxes
o Save, continue,
o Click on Edit -> Set Release.
5. Creating the Basic IDOC Object
o Go to T. code WE30
o Give obj. name as ZBAPI_STUD_IDOC
o Click on create
o Select create new radio button, give description and continue
o Select the IDOC obj name and click on create button
o Enter the segment name which is create earlier
o Select the check box if you want to make the segment mandatory
o Enter 1 in minimum number 99999 in maximum number, continue
o Save and back
o Click on Edit -> Set Release
6. Creating Customer Distribution Model
o Go to T. Code BD64
o Click on change and Create model view button
o Enter the short text and Technical name as ZSTUDENT
o Select the model and click on Add Message Type Button
o Give the Sender as STUD_S,
o Receiver as STUD_R,
o Message Type as ZBAPI_STUD_MAS
o Select the model view & click on Environment -> Generate Partner Profiles
o Select Transfer IDOC Immediately and Trigger Immediately radio buttons
o Click on Execute
o You should get a list in green color which means it executed successfully.
o Back to main screen, select the model view
o Click Edit->Model view->Distribute
o Click on continue
o You should get a list saying model view is distributed successfully.
7. Checking the Port
o Go to T. Code WE21
o Expand Transactional RFC
o Find the port from the list which is created using BD64 for STUD_R (Receiving system) RFC Destination.
8. Checking the Partner Profiles.
o Go to T. Code WE20
o Expand Partner Type LS
o Select the Partner profile STUD_R
o Double click on Message Type ZBAPI_STUD_MAS in Outbound parmtrs.
o Check Receiver Port is assigned correctly
o Check the Basic type as your Basic IDOC object.
9. Assigning the Message Type to Basic IDOC Object
o Go to T. Code WE82
o Click on Change & continue, New Entries button
o Give the Message type as ZBAPI_STUD_MAS
o Give Basic Type as ZBAPI_STUD_IDOC
o Release as 46C
o Save and back
10. Creating Inbound Function Module (Posting Program)
o Go to T. Code SE37
o Create a function Module IDOC_INPUT_ZBAPI_STUD_MAS
o Set the Processing type as Remote Enabled Module and mode as start immed, in Attributes Tab.
o Import Parameters
INPUT_METHOD LIKE BDWFAP_PAR-INPUTMETHD
MASS_PROCESSING LIKE BDWFAP_PAR-MASS_PROC
NO_APPLICATION_LOG LIKE SY-DATAR
MASSSAVEINFOS LIKE MASSSAVINF
o Export Parameters
WORKFLOW_RESULT LIKE BDWF_PARAM-RESULT
APPLICATION_VARIABLE LIKE BDWF_PARAM-APPL_VAR
IN_UPDATE_TASK LIKE BDWFAP_PAR-UPDATETASK
CALL_TRANSACTION_DONE LIKE BDWFAP_PAR-CALLTRANS
o Tables
IDOC_CONTRL LIKE EDIDC
IDOC_DATA LIKE EDIDD
IDOC_STATUS LIKE BDIDOCSTAT
RETURN_VARIABLES LIKE BDWFRETVAR
SERIALIZATION_INFO LIKE BDI_SER
o Exceptions
WRONG_FUNCTION_CALLED
o Source Code
DATA: FIRST_TRANC LIKE MARA_UEB-TRANC,
ZBAPI_STUD_SEG like zbapi_stud.
DATA: ZBAPI_STUD LIKE ZBAPI_STUD.
DATA: I_ZBAPI_STUD LIKE ZBAPI_STUD.
DATA: C_TRUE VALUE 'X'.
DATA: C_FALSE VALUE ' '.
DATA: BEGIN OF T_IDOC_ROLLNO OCCURS 0,
DOCNUM LIKE EDIDC-DOCNUM,
ROLLNO LIKE ZBAPI_STUD-ROLLNO,
END OF T_IDOC_ROLLNO.
DEFINE APPEND_RESFIELDS.
PERFORM APPEND_RES_FIELDS TABLES T_MFIELDRES
T_RES_FIELDS
USING &1
COUNTER-D_IND.
END-OF-DEFINITION.
DATA: I_MARA_UEB LIKE MARA_UEB.
DATA: I_ZSTUD_UEB LIKE ZBAPI_STUD.
DATA: I_MAKT_UEB LIKE MAKT_UEB.
DATA: I_MARC_UEB LIKE MARC_UEB.
DATA: I_MARD_UEB LIKE MARD_UEB.
DATA: I_MFHM_UEB LIKE MFHM_UEB.
DATA: I_MARM_UEB LIKE MARM_UEB.
DATA: I_MEAN_UEB LIKE MEA1_UEB.
DATA: I_MBEW_UEB LIKE MBEW_UEB.
DATA: I_STEU_UEB LIKE STEU_UEB.
DATA: I_STEUMM_UEB LIKE STEUMM_UEB.
DATA: I_MLGN_UEB LIKE MLGN_UEB.
DATA: I_MLGT_UEB LIKE MLGT_UEB. " //br010797 neu zu 4.0
DATA: I_MPGD_UEB LIKE MPGD_UEB.
DATA: I_MPOP_UEB LIKE MPOP_UEB.
DATA: I_MVEG_UEB LIKE MVEG_UEB.
DATA: I_MVEU_UEB LIKE MVEU_UEB.
DATA: I_MVKE_UEB LIKE MVKE_UEB.
DATA: I_MPRW_UEB LIKE MPRW_UEB.
DATA: I_LTX1_UEB LIKE LTX1_UEB.
DATA: HELP_MARC_UEB LIKE MARC_UEB.
DATA: T_MARA_UEB LIKE MARA_UEB OCCURS 0.
DATA: T_MAKT_UEB LIKE MAKT_UEB OCCURS 0.
DATA: T_MARC_UEB LIKE MARC_UEB OCCURS 0.
DATA: T_MARD_UEB LIKE MARD_UEB OCCURS 0.
DATA: T_MFHM_UEB LIKE MFHM_UEB OCCURS 0.
DATA: T_MARM_UEB LIKE MARM_UEB OCCURS 0.
DATA: T_MEAN_UEB LIKE MEA1_UEB OCCURS 0.
DATA: T_MBEW_UEB LIKE MBEW_UEB OCCURS 0.
DATA: T_STEU_UEB LIKE STEU_UEB OCCURS 0.
DATA: T_STEUMM_UEB LIKE STEUMM_UEB OCCURS 0.
DATA: T_MLGN_UEB LIKE MLGN_UEB OCCURS 0.
DATA: T_MLGT_UEB LIKE MLGT_UEB OCCURS 0. " //br010797 neu zu 4.0
DATA: T_MPGD_UEB LIKE MPGD_UEB OCCURS 0.
DATA: T_MPOP_UEB LIKE MPOP_UEB OCCURS 0.
DATA: T_MVEG_UEB LIKE MVEG_UEB OCCURS 0.
DATA: T_MVEU_UEB LIKE MVEU_UEB OCCURS 0.
DATA: T_MVKE_UEB LIKE MVKE_UEB OCCURS 0.
DATA: T_MPRW_UEB LIKE MPRW_UEB OCCURS 0.
DATA: T_LTX1_UEB LIKE LTX1_UEB OCCURS 0.
Internal fields/ tables
DATA: FLAG_ERROR_HAPPENED.
DATA: flag_material_exists. "//br210397 zu 4.0 keine Verwendung mehr
DATA: FLAG_EXIT_TO_BE_DONE.
DATA: HELP_TABIX LIKE SY-TABIX.
DATA: HELP_TRANC LIKE MARA_UEB-TRANC.
DATA: HELP_ALAND LIKE STEU_UEB-ALAND.
DATA: HELP_VKORG LIKE MVKE-VKORG.
DATA: HELP_WERKS LIKE T001W-WERKS.
DATA: HELP_LFDNR LIKE STEU_UEB-LFDNR.
DATA: LAST_MARC_TRANC LIKE MARA_UEB-TRANC.
DATA: LAST_MLGN_TRANC LIKE MARA_UEB-TRANC. " //br010797 neu zu 4.0
DATA: LAST_TEXT_TRANC LIKE MARA_UEB-TRANC.
DATA: CURRENT_TABIX LIKE SY-TABIX.
DATA: GENERAL_SUBRC LIKE SY-SUBRC.
DATA: HELP_FACTOR TYPE P DECIMALS 3.
DATA: USER_SEGMENTS LIKE EDIDD OCCURS 0 WITH HEADER LINE. " insert
DATA: CUST_SEGMENT LIKE EDIDD.
DATA: I_MFIELDRES LIKE MFIELDRES.
DATA: I_MERRDAT LIKE MERRDAT.
DATA: I_EDIDD LIKE EDIDD.
" //br neu zu 3.1g
DATA: T_RES_FIELDS LIKE DELFIELDS OCCURS 0 WITH HEADER LINE.
DATA: T_MFIELDRES LIKE MFIELDRES OCCURS 0.
DATA: T_MERRDAT LIKE MERRDAT OCCURS 0.
DATA: T_EDIDD LIKE EDIDD OCCURS 0.
DATA: BEGIN OF t_matnr OCCURS 0, "//br210397 zu 4.0
matnr LIKE mara-matnr, " wird nicht mehr verwendet
END OF t_matnr. "
DATA: BEGIN OF COUNTER,
TRANC LIKE MARA_UEB-TRANC,
D_IND LIKE MARA_UEB-D_IND,
END OF COUNTER.
DATA: BEGIN OF t_idoc_tranc OCCURS 0, " 4.0
docnum LIKE edidc-docnum, "
tranc LIKE mara_ueb-tranc, "
END OF t_idoc_tranc. "
DATA T_IDOC_TRANC LIKE MATIDOCTRANC OCCURS 0 WITH HEADER LINE."
DATA: FLAG_FITS.
DATA: APPLICATION_SUBRC LIKE SY-SUBRC.
DATA FLAG_MUSS_PRUEFEN LIKE SY-DATAR.
DATA MAX_ERRORS LIKE T130S-ANZUM. " 4.0
note 419281
DATA : FLG_MASS.
CLEAR : FLG_MASS.
FIELD-SYMBOLS: . " 4.0
ALE-distribution unity : IDOC status set by locking "note0361838
data: "note0361838
it_dsp_idocstat like bdidocstat "note0361838
occurs 0 with header line. "note0361838
Initialize data - general
REFRESH T_MFIELDRES.
REFRESH T_IDOC_TRANC.
REFRESH T_IDOC_TRANC. "JH/02.02.98/4.0C KPr100004993
REFRESH t_idoc_tranc_segment. " //br 40 : unnötig
REFRESH matnr_tranc. " -"-
REFRESH t_matnr.
COUNTER-TRANC = 1.
COUNTER-D_IND = 1.
REFRESH T_MARA_UEB.
REFRESH T_MAKT_UEB.
REFRESH T_MARC_UEB.
REFRESH T_MARD_UEB.
REFRESH T_MFHM_UEB.
REFRESH T_MARM_UEB.
REFRESH T_MEAN_UEB.
REFRESH T_MBEW_UEB.
REFRESH T_STEU_UEB.
REFRESH T_STEUMM_UEB.
REFRESH T_MLGN_UEB.
REFRESH T_MLGT_UEB. " //br010797 neu zu 4.0
REFRESH T_MPGD_UEB.
REFRESH T_MPOP_UEB.
REFRESH T_MVEG_UEB.
REFRESH T_MVEU_UEB.
REFRESH T_MVKE_UEB.
REFRESH T_MPRW_UEB.
REFRESH VKORG_ALAND.
REFRESH WERKS_ALAND.
CLEAR APPLICATION_SUBRC.
REFRESH T_MERRDAT.
Check if right function is called
READ TABLE IDOC_CONTRL INDEX 1.
IF SY-SUBRC <> 0.
EXIT.
ELSE.
IF IDOC_CONTRL-IDOCTP <> 'ZBAPI_STUD_IDOC'.
RAISE WRONG_FUNCTION_CALLED.
ENDIF.
ENDIF.
LOOP AT IDOC_CONTRL.
Initialize data - per IDOC
t_idoc_tranc-docnum = counter-tranc.
T_IDOC_TRANC-DOCNUM = IDOC_CONTRL-DOCNUM.
T_IDOC_TRANC-FIRST_TRANC_IDOC = COUNTER-TRANC + 2.
APPEND T_IDOC_TRANC.
Select segments which belong to IDOC
REFRESH T_EDIDD.
LOOP AT IDOC_DATA WHERE DOCNUM = IDOC_CONTRL-DOCNUM.
APPEND IDOC_DATA TO T_EDIDD.
ENDLOOP.
BUSINESS TRANSACTION EVENT (header / data) "note0388000
call function 'OPEN_FI_PERFORM_MGV00200_E' "note0388000
exporting "note0388000
idoc_header = idoc_contrl "note0388000
FLG_APPEND_STATUS = 'X' "note0388000
tables "note0388000
(DEL) idoc_data = idoc_data "note0388000 note0418561
idoc_data = t_edidd "note0418561
idoc_status = idoc_status "note0388000
exceptions "note0388000
others = 1. "note0388000
if sy-subrc = 1. "note0388000
continue. "note0388000
endif. "note0388000
Within one IDOC: loop through data segments:
Prepare internal tables for the current material
LOOP AT T_EDIDD INTO IDOC_DATA.
Transform from CoreData to Normal Data if necesary
CASE IDOC_DATA-SEGNAM.
WHEN 'E1MARAC'.
*--COMMENTED BY SATISH
PERFORM MOVE_E1MARAC_TO_E1MARAM USING IDOC_DATA.
WHEN 'E1MAKTC'.
PERFORM MOVE_E1MAKTC_TO_E1MAKTM USING IDOC_DATA.
*--COMMENTES ENDED BY SATISH
WHEN 'ZBAPI_STUD_SEG'.
PERFORM MOVE_E1MARAC_TO_E1MARAM USING IDOC_DATA.
CLEAR I_ZBAPI_STUD.
Second: Move E1MARAC into E1MARAM
I_ZBAPI_STUD = IDOC_DATA-SDATA.
Third: Move E1MARAM back into IDOC-line
IDOC_DATA-SDATA = I_ZBAPI_STUD.
IDOC_DATA-SEGNAM = 'ZBAPI_STUD_SEG'.
ENDCASE.
CURRENT_TABIX = SY-TABIX.
COUNTER-D_IND = COUNTER-D_IND + 1.
COUNTER-TRANC = COUNTER-TRANC + 2.
CASE IDOC_DATA-SEGNAM.
WHEN 'ZBAPI_STUD_SEG'.
Initialize data - per material
COUNTER-D_IND = 1.
FIRST_TRANC = COUNTER-TRANC.
interpret segment
ZBAPI_STUD_SEG = IDOC_DATA-SDATA.
MOVE-CORRESPONDING ZBAPI_STUD TO I_ZSTUD_UEB.
T_IDOC_ROLLNO-DOCNUM = IDOC_CONTRL-DOCNUM.
T_IDOC_ROLLNO-ROLLNO = I_ZSTUD_UEB-ROLLNO.
APPEND T_IDOC_ROLLNO.
ENDCASE.
if not ZBAPI_STUD_SEG is initial.
ZBAPI_STUD-MANDT = ZBAPI_STUD_SEG-MANDT.
ZBAPI_STUD-ROLLNO = ZBAPI_STUD_SEG-ROLLNO.
ZBAPI_STUD-FNAME = ZBAPI_STUD_SEG-FNAME.
ZBAPI_STUD-LNAME = ZBAPI_STUD_SEG-LNAME.
INSERT ZBAPI_STUD FROM ZBAPI_STUD_SEG.
COMMIT WORK.
ENDIF.
*-- ALE ditribution unity : update IDOC status "note03618
LOOP AT it_dsp_idocstat. "note036
LOOP AT IDOC_STATUS WHERE DOCNUM = it_dsp_idocstat. "note036
DELETE idoc_status INDEX sy-tabix. "note036
ENDLOOP. "note036
APPEND it_dsp_idocstat TO idoc_status. "note036
ENDLOOP. "note036
*--GENERATING THE IDOC STATUS
PERFORM HANDLE_ERROR_EXT " //br40
TABLES "
IDOC_CONTRL "
IDOC_STATUS "
RETURN_VARIABLES "
T_MERRDAT "
T_IDOC_TRANC "
T_IDOC_ROLLNO "JH/4.0C/KPr100004993
USING "
GENERAL_SUBRC "
NO_APPLICATION_LOG "
MASSSAVEINFOS "wk/40c
CHANGING "
WORKFLOW_RESULT. "
PERFORM HANDLE_ERROR
TABLES
IDOC_CONTRL
IDOC_STATUS
RETURN_VARIABLES
T_MERRDAT
T_IDOC_ROLLNO "JH/4.0C/KPr100004993
USING
APPLICATION_SUBRC
CHANGING
WORKFLOW_RESULT.
SORT T_IDOC_ROLLNO BY ROLLNO. "note 315124
React on general error
DATA: I_MERRDAT LIKE MERRDAT.
IF GENERAL_SUBRC <> 0.
I_MERRDAT-MSGTY = 'E'.
I_MERRDAT-MSGID = SY-MSGID.
I_MERRDAT-MSGNO = SY-MSGNO.
I_MERRDAT-MSGV1 = SY-MSGV1.
I_MERRDAT-MSGV2 = SY-MSGV2.
I_MERRDAT-MSGV3 = SY-MSGV3.
I_MERRDAT-MSGV4 = SY-MSGV4.
APPEND I_MERRDAT TO T_MERRDAT.
ENDIF.
LOOP AT T_MERRDAT INTO I_MERRDAT
WHERE MSGTY = 'S' "success
OR MSGTY = 'D' "dummy
OR MSGTY = 'I' "Information " //br011097 zu 3.1I
OR MSGTY = 'H' "dummy " 4.0
OR MSGTY = 'W'. "warning
DELETE T_MERRDAT.
ENDLOOP.
ENDLOOP.
ENDLOOP.
ENDFUNCTION.
*& Form handle_error_ext
FORM HANDLE_ERROR_EXT
TABLES
IDOC_CONTRL STRUCTURE EDIDC
IDOC_STATUS STRUCTURE BDIDOCSTAT
RETURN_VARIABLES STRUCTURE BDWFRETVAR
T_MERRDAT STRUCTURE MERRDAT
IDOC_TRANC STRUCTURE MATIDOCTRANC
JH/02.02.98/4.0C KPr100004993 (Anfang)
T_IDOC_ROLLNO STRUCTURE T_IDOC_ROLLNO
JH/02.02.98/4.0C KPr100004993 (Ende)
USING
GENERAL_SUBRC LIKE SY-SUBRC
NO_APPLICATION_LOG LIKE SY-DATAR
MASSSAVEINFOS LIKE MASSSAVINF
CHANGING
WORKFLOW_RESULT LIKE BDWF_PARAM-RESULT.
DATA FLAG_ERROR_HAPPENED.
DATA I_MERRDAT LIKE MERRDAT.
DATA IDOC_INDEX_2_SUBRC LIKE SY-SUBRC.
DATA AL_HANDLES TYPE BAL_T_LOGH. "//br99
SORT T_IDOC_ROLLNO BY ROLLNO. "note 315124
React on general error
IF GENERAL_SUBRC <> 0.
REFRESH T_MERRDAT.
i_merrdat-tranc = 0. " //br261197
READ TABLE IDOC_TRANC INDEX 1. " zu 40b
I_MERRDAT-TRANC = IDOC_TRANC-FIRST_TRANC_IDOC. "
I_MERRDAT-MSGTY = 'E'.
I_MERRDAT-MSGID = SY-MSGID.
I_MERRDAT-MSGNO = SY-MSGNO.
I_MERRDAT-MSGV1 = SY-MSGV1. I_MERRDAT-MSGV2 = SY-MSGV2.
I_MERRDAT-MSGV3 = SY-MSGV3. I_MERRDAT-MSGV4 = SY-MSGV4.
APPEND I_MERRDAT TO T_MERRDAT.
ENDIF.
DATA: C_TRUE,
C_FALSE VALUE 'X'.
If error happened ==> Rollback whole work....
LOOP AT T_MERRDAT INTO I_MERRDAT WHERE MSGTY NA 'SDHWI'.
EXIT.
ENDLOOP.
IF SY-SUBRC = 0.
FLAG_ERROR_HAPPENED = C_TRUE.
ROLLBACK WORK.
ELSE.
FLAG_ERROR_HAPPENED = C_FALSE.
ENDIF.
Set IDOC status
two cases:
single IDOC-processing: ==> error can be written in IDOC status
package processing ==> anononymous "package error" for all IDOCs
READ TABLE IDOC_CONTRL INDEX 2.
IDOC_INDEX_2_SUBRC = SY-SUBRC.
IF SY-SUBRC = 0.
IF 1 = 2. "//br40
MESSAGE E051(B1). "
ENDIF. "
CLEAR I_MERRDAT.
I_MERRDAT-MSGID = 'B1'.
I_MERRDAT-MSGTY = 'E'.
I_MERRDAT-MSGNO = '051'.
ENDIF.
IF IDOC_INDEX_2_SUBRC NE 0 OR FLAG_ERROR_HAPPENED = C_FALSE.
Nur in diesen Fällen wird Application Log geschrieben
Delete all Successes and Dummy records from t_merrdat
DELETE t_merrdat WHERE msgty = 'S' "success " testweise
OR msgty = 'D'. "dummy "
LOOP AT T_MERRDAT INTO I_MERRDAT WHERE MSGTY = 'D'. "
I_MERRDAT-MSGTY = 'S'. "
MODIFY T_MERRDAT FROM I_MERRDAT. "
ENDLOOP. "
ENDIF.
WORKFLOW_RESULT = 0.
LOOP AT IDOC_CONTRL.
Set IDOC status
CLEAR IDOC_STATUS.
IDOC_STATUS-DOCNUM = IDOC_CONTRL-DOCNUM.
IF FLAG_ERROR_HAPPENED = C_FALSE.
Application log
PERFORM WRITE_APPL_LOG TABLES IDOC_TRANC
T_MERRDAT
IDOC_STATUS
USING IDOC_CONTRL
FLAG_ERROR_HAPPENED
NO_APPLICATION_LOG
MASSSAVEINFOS
AL_HANDLES.
idoc_status-status = '53'. "OK!
APPEND idoc_status.
JH/02.02.98/4.0C KPr100004993 (Anfang)
Fill Return variables
CLEAR RETURN_VARIABLES.
RETURN_VARIABLES-DOC_NUMBER = IDOC_CONTRL-DOCNUM.
RETURN_VARIABLES-WF_PARAM = 'Processed_IDOCs'.
APPEND RETURN_VARIABLES.
Verknüpfungseintrag anlegen
READ TABLE T_IDOC_ROLLNO WITH KEY ROLLNO = IDOC_CONTRL-DOCNUM
BINARY SEARCH.
IF SY-SUBRC = 0.
RETURN_VARIABLES-DOC_NUMBER = T_IDOC_ROLLNO-ROLLNO.
RETURN_VARIABLES-WF_PARAM = 'Appl_Objects'.
APPEND RETURN_VARIABLES.
ENDIF.
JH/02.02.98/4.0C KPr100004993 (Ende)
ELSE.
IF IDOC_INDEX_2_SUBRC NE 0.
Application Log
PERFORM WRITE_APPL_LOG TABLES IDOC_TRANC
T_MERRDAT
IDOC_STATUS
USING IDOC_CONTRL
FLAG_ERROR_HAPPENED
NO_APPLICATION_LOG
MASSSAVEINFOS
AL_HANDLES.
ELSE.
IDOC_STATUS-MSGID = I_MERRDAT-MSGID.
IDOC_STATUS-MSGTY = I_MERRDAT-MSGTY.
IDOC_STATUS-MSGNO = I_MERRDAT-MSGNO.
IDOC_STATUS-MSGV1 = I_MERRDAT-MSGV1.
IDOC_STATUS-MSGV2 = I_MERRDAT-MSGV2.
IDOC_STATUS-MSGV3 = I_MERRDAT-MSGV3.
IDOC_STATUS-MSGV4 = I_MERRDAT-MSGV4.
IDOC_STATUS-STATUS = '51'. "ERROR!
APPEND IDOC_STATUS.
ENDIF.
Fill Return variables
CLEAR RETURN_VARIABLES.
RETURN_VARIABLES-DOC_NUMBER = IDOC_CONTRL-DOCNUM.
return_variables-wf_param = c_wf_par_processed_idocs.
RETURN_VARIABLES-WF_PARAM = 'Error_IDOCs'.
APPEND RETURN_VARIABLES.
WORKFLOW_RESULT = 99999.
ENDIF.
APPEND idoc_status.
ENDLOOP.
IF NO_APPLICATION_LOG IS INITIAL.
CALL FUNCTION 'BAL_DB_SAVE' "//br99
EXPORTING
I_IN_UPDATE_TASK = ' '
I_SAVE_ALL = ' '
I_T_LOG_HANDLE = AL_HANDLES.
EXCEPTIONS
LOG_NOT_FOUND = 1
SAVE_NOT_ALLOWED = 2
NUMBERING_ERROR = 3
OTHERS = 4.
CALL FUNCTION 'BAL_GLB_MEMORY_REFRESH' "//br99
EXPORTING
I_AUTHORIZATION =
I_REFRESH_ALL = ' '
I_T_LOGS_TO_BE_REFRESHED = AL_HANDLES.
EXCEPTIONS
NOT_AUTHORIZED = 1
OTHERS = 2
ENDIF.
ENDFORM. " handle_error
Save, check and activate
11. Assigning the Inbound Function Module to Basic Type & Message Type
o Go to T. Code WE57
o Click on change, continue, continue and New Entries Button
o Enter the Module as IDOC_INPUT_ZBAPI_STUD_MAS
o Type as F
o Basic Type as ZBAPI_STUD_IDOC
o Message Type as ZBAPI_STUD_MAS.
o Direction as 2
o Save and back
Now Login in 810 client
12. Assigning the Inbound Function Module in ALE Table
o Go to T. Code BD51
o Click on continue, New Entries button
o Give the Inbound Function Module IDOC_INPUT_ZBAPI_STUD_MAS
o Give Input t. as 0 (zero)
o Save and back
13. Creating Process Code
o Go to T. Code WE42
o Click on Change, New Entries Button
o Give Process Code name as ZSTUD, give Description & Save
o Select Processing with ALE Services Radio button
o Select Processing by Function Module Radio button
o Click the ALE Table (arrow Icon) in Identification
o Give the Function Module Name ZIDOC_INPUT_ZBAPI_STUD_MAS
o Give maximum number of repeats 0
o Save and back, back
o Select the process code from the list & click on Logical Messages Icon
o Give the Message Type as ZBAPI_STUD_MAS
o Save & Back, Save & Back, Save & Back
14. Changing the Customer Distribution model in Receiving system
o Go to T. Code BD64
o Click on change and Create model view button
o Select the model view & click on Environment -> Generate Partner Profiles
o Select Transfer IDOC Immediately and Trigger Immediately radio buttons
o Click on Execute
o You should get a list in green color which means it executed successfully.
15. Assigning the Process Code to Message Type in Receiving System
o Go to T. Code WE20
o Expand Partner Type LS
o Select the Partner Profile STUD_S
o Double click on Message Type ZBAPI_STUD_MAS in Inbound parmtrs.
o Give the Process Code as ZSTUD
o Click on Trigger Immediately Radio button
o Save & Back
o Save & Back
16. Creating the Selection Program (Outbound Program)
Login in client 800.
Go to T. Code SE38
Create a Report Program as ZSTUD_SEND with the following code
REPORT ZSTUD_SEND
NO STANDARD PAGE HEADING.
TABLES: ZBAPI_STUD.
DATA: IT_STUD LIKE ZBAPI_STUD OCCURS 0 WITH HEADER LINE.
SELECTION-SCREEN:BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-H01.
SELECT-OPTIONS: S_ROLLNO FOR ZBAPI_STUD-ROLLNO.
SELECTION-SCREEN SKIP.
SELECTION-SCREEN:BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-H02.
PARAMETERS: P_MESTYP LIKE EDIDC-MESTYP,
P_RCVPRN LIKE TBDLST-LOGSYS.
SELECTION-SCREEN:END OF BLOCK B2.
SELECTION-SCREEN:END OF BLOCK B1.
START-OF-SELECTION.
PERFORM CREATE_STUDENT.
PERFORM CREATE_IDOC.
*& Form CREATE_STUDENT
sending student
FORM CREATE_STUDENT.
SELECT * FROM ZBAPI_STUD
INTO TABLE IT_STUD
WHERE ROLLNO IN S_ROLLNO.
ENDFORM. " CREATE_STUDENT
*& Form CREATE_IDOC
IDOC Creation
FORM CREATE_IDOC.
DATA : IMAS_DATA LIKE EDIDD OCCURS 10 WITH HEADER LINE,
IMAS_CON LIKE EDIDC OCCURS 10 WITH HEADER LINE,
ICOM_CON LIKE EDIDC OCCURS 10 WITH HEADER LINE.
IMAS_CON-RCVPRT = 'LS'.
IMAS_CON-RCVPRN = P_RCVPRN.
IMAS_CON-IDOCTP = 'ZBAPI_STUD_IDOC'.
IMAS_CON-MESTYP = P_MESTYP.
IMAS_CON-DIRECT = 1.
APPEND IMAS_CON.
LOOP AT IT_STUD.
IMAS_DATA-SEGNAM = 'ZBAPI_STUD_SEG'.
IMAS_DATA-SDATA = IT_STUD.
APPEND IMAS_DATA.
ENDLOOP.
CALL FUNCTION 'MASTER_IDOC_DISTRIBUTE'
EXPORTING
MASTER_IDOC_CONTROL = IMAS_CON
OBJ_TYPE = ''
CHNUM = ''
TABLES
COMMUNICATION_IDOC_CONTROL = ICOM_CON
MASTER_IDOC_DATA = IMAS_DATA
EXCEPTIONS
ERROR_IN_IDOC_CONTROL = 1
ERROR_WRITING_IDOC_STATUS = 2
ERROR_IN_IDOC_DATA = 3
SENDING_LOGICAL_SYSTEM_UNKNOWN = 4
OTHERS = 5
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
COMMIT WORK.
LOOP AT ICOM_CON.
WRITE :/ 'IDOC: ', ICOM_CON-DOCNUM, 'CREATED SUCCESSFULLY'.
ENDLOOP.
ENDFORM. " CREATE_IDOC
17. Transferring the student records from 800 to 810 client
Execute Report Program ZSTUD_SEND
Give the Range of Roll Nos to Transfer
Give Message Type as ZBAPI_STUD_MAS
Give Receiver Logical system as STUD_R
Execute
You should get the IDOC Number
Take the IDOC Number and go to T. Code WE05 & Execute
In Outbox you can see the IDOC Status
Select the status record in left side window
Double click on the Status record in right side window
You can see the Control Record, Data Record and Status Records for that IDOC
If the ICON is green and the status code is 3, it means the IDOC is passed to PORT Successfully.
Now Login in 810 client
Go to T. Code WE05 & Execute
You can see the status record in left side window
If the status no is 53 and color is green, it means the IDOC is Posted to Application successfully.
You can see the Log Information by double clicking on the status record in right side window.
Now in left side window, you can see the Control Record, Data Record & Status Record of the IDOC
Now go to T. Code SE16
Give the table name ZBAPI_STUD & press F7
See the contents of the table
The table is updated with the students records transferred from 800 client with our selection program.
Reward if useful
Thanks
Jagadeesh.G -
Stop Crystal from Prompting for Parameters
Hi there,
I am trying to stop Crystal from prompting for a parameter that has the Optional Prompt flag set to True as I want to use the HasNoValue attribute to retrieve all records when there is not a specific value sent to the parameter.
When the parameter is created from a store procedure, I can simply set the value to nothing and handle the resulting NULL in the procedure.
I was expecting that I could do the same for the regular parameters but this returns a "parameter field and parameter field current values are not compatible" error.
I have tried setting the HasCurrentValue to True but this is a read only attribute.
I have also tried setting the Viewer.ReuseParameterValuesOnRefresh to False (and True) but the report still prompts for the parameter.
I have searched the web for the last two days and have had no joy on this so any help or pointers would be appreciated.
Thanking you in advanceHi Don,
I am using Crystal 2008 for both the report and the assemblies.
Using the word All is not really an option as I need to process all types of parameters i.e. Boolean, integers and dates as well as strings.
I could create some complex formulas to handle this but I need the report creation to be simple as possible as possible so that the customer can create reports at will.
Using the Optional Prompt feature now available in 2008 I can create a simple record selection formula that looks like something like this :-
(not HasValue({?MyParameter}) OR {Table1.Field1} = {?MyParameter})
My problem is getting the parameter to register through my code that it has been set to HasValue = False so that the user is not prompted by the viewer to enter the parameter again. -
Identifying triger point & stoping an idoc from getting generated in SD
We have 2 boxes
KLE 420 ( CRM box) & KLE 430 ( SC box)
As per original business flow
1) Sales order is generated in 420 ( order type Z001, item category ZAN1 )
2) idoc is generated and message/details is transferred to 430 ( Z002, ZAN2 )
3) in 430 the delivery & shipment is created and idoc is generated and transferred back to 420 where the invoicing happens.
As per new flow
For some selected orders, the initiation(SO) and processing needs to be completed in 430 (SC) only
When I run an order cycle, a few things I need to know is
1) how do I identify for which steps in the order cycle, an idoc is being generated
2) how can I stop this Idoc from being generated ?Hi there,
From my experience I have seen IDOCS triggered by O/p types that are assigned to SD documents in SAP.
If that is the case, then check the sales orders what O/p types it is triggering & which O/p is triggered by EDI.
Delete the condition records for that particular O/p which is triggered by EDI. This will make the O/p not generated.
Also remove the O/p type in the determination procedure of you dont need that O/p at all. Or in the requirment routine, specify a condition like sales org or order type for which the O/p should trigger. So basing on the condition you mentioned, system will trigger the O/p accordingly.
If IDOCS are not triggered by the O/p type, then it is trigered by an external prog. In that case, specify a condition (like above) that system should not trigger the IDOCs.
Hope this helps. -
IDOC from One System to another
Hi All,
I am sending idocs from one system to another For Eg System A to System B .
Now suppose 2 idocs are generated 1 and 2.
Now how to determine , for idoc 1 in system A, what is the corresponding Inbound Idoc in System B because the data which is coming in System B might be different than in System A for the same Idoc?
Thanks in Advance.Hi,
direction 1 for outbound idoc,
2 for inbound idoc,
goto tcode WE02
enter direction - 2.
creation date
and basic type i.e. idoc type
double click on an idoc num.
on L.H.S u have 'Control REc' double click on it..
it contains all the sender details and to what outbound idoc it corressponds to -> basic type, message type
-> Partner details like partner num, port, partner type
-> date & time of creation
-> and the other details
Regards,
Neelima. -
Send IDOC from Business Connector to SAP faster
Hi Developer!
I need to send a very lot of IDOC converted from XML files from the Business Connector to SAP. The XML files are in different directories pro business partner, but they have a same type (ISU_MSCONS).
My problem, that the import take a lot of time. Only in every 3 seconds (IDOC creation time) gets (or works up?) the SAP one IDOC. I start diferent services pro partner at the same time to import the IDOCs, but I couldnt short the 3 second work time in the SAP. So you can count it easy, that in 1 minute I can import 20, in 1 hour 1200, in 1 day 28800 IDOCs instead of 100.000.
It is really parallel import? Have anybody any idea to make the import more faster. I know (asked the SAP Administrator) so, one BC - SAP connection (Program_ID) has more pools (= threads) in the SAP at the same time.
Thanks any help,
CharlieHi Satish,
You can achieve this requirement
1)If your external system going to support web service cals then send IDoc from External system as a web service, in PI use sender side SOAP and receiver side IDoc receiver channel to send IDoc.
or
2)Use proxy program ,implement the same ALE logic in PI.
or
3)Copy the Extenal IDoc message in to file folder as XML,then use file adapter to pick up this message and send it SAP using IDoc.
Regards,
raj -
Problem uploading an IDOC from File
hello everybody,
I'm using function IDOC_XML_TRANSFORM to upload an IDOC from a file, I have a problem with the function cause is searching the segments of the idoc in table EDSAPPL, now the problem is that the segment is not in that table, it should exist cause the IDOC was generated by the same system, now is there a process that should be done to update this table?, thanks in advance.
Regards,
Julio Cesar Ruizhi
chk this
Re: iDOC creation from a flat file
hope this helps
regards
Aakash Banga
Maybe you are looking for
-
IGoogle doesn't display properly
Hello all, Yesterday, all was fine. Today, my iGoogle page won't display properly (running Safari - OSX 10.3.9 Panther). Get a notice that: 'Home tab has been sent. Sending failed.' Brother Mac running Panther has same problem. Page displays properly
-
Mp4 video in wordpress is not responsive after update
Hi Since updating wordpress to 4.1 my mp4 videos are no longer responsive. see http://theirmustbeaneasierway.com I thought it was a custom theme issue but now have it on 2015 theme and it still exists. The site works perfect on all other browsers. It
-
Field FNAME displayed in german..
In standard report *RFKABL00* field *FNAME* sometimes display text in german and sometimes in english. What Could be the reason? John. Edited by: JohnMell02 on Feb 9, 2010 2:52 PM Edited by: JohnMell02 on Feb 9, 2010 3:01 PM
-
One Unix Question......
All, In our Application we've a KSH program for sending mails. We found a new bug while sending the attachment if the path contains forward slash "/". So we intend to relace the "/" as "\" in ksh. Could you please anyone tell us how to achive the abo
-
The internal screen of my Powerbook g4 is no longer recognized as a Color LCD (1440x900) screen, but rather as a VGA screen (800x600). If I reboot enough times it'll eventually be recognized correctly but that may take anywhere from 1 - 100+ reboots