Help: one request using ALE&IDOC to Posting Goods Issue about MaterialScrap

Hi Exports,
i got a situation. My client is using ALE&IDOC to deal with the Material Scrapping. The business scenario is:
1. One third system (Non-SAP) Send IDOC to SAP Production Server through the Intermedia SEEBEYOND.
    Message Type: MBGMCR
    IDOC Type: MBGMCR02
    BUSINESS OBJECT: BUS2017
2. SAP Production Server use "Message Type: MBGMCR" to find out the BAPI in Distribution Model and trigger the BAPI.
the Distribution Model:
Model View
SEEBEYONG
PRODUCTION
GoodsMovement.CreateFromData
Reciever determination: no filter
Now my client's request is:
When the Movement Type is 551 in the IDOC Segment "E1BP2017_GM_ITEM_CREATE", This IDOC will be ignore and not trigger the BAPI to post goods issue.
i try to add the destination filter in the Distribution Model. but when i add the filter group, there are only two filter parameter ("Plant" and "Storage Location") and don't allow to add others.
i have no idea now. can anyone give me a favor. thank you very much in advance.
Edited by: Dave Wang on Feb 29, 2008 7:09 AM

We got hold of the Idoc type 'DELVRY03 PGI SHPCON' we are able to post the Idoc but we are able to do the packing only or we are able to change the deliveries but the PGI is not happening..
please help us on this.. is there some condig that updates the delivery with the PGi or is there something else do be done in the Idoc....
will provide additional details if required.
Thanks
Arun

Similar Messages

  • Generate DELVRY  Idoc when Post goods issue is done in SAP

    I need to generate an Idoc when post goods issue is done in SAP (outbound to SAP) .I understood that I can do this using the message control .The message type DESADV with the process code DELV will support this.
    But I didn’t understand how to trigger the Idoc.In the current scenario our Company is doing the post goods issue in SAP for the in three different ways.
    1.Manually doing the post goods issue through the transaction VL02N
    2. an Inbound Interface (using Idoc)  which will do Post goods Issue in SAP
    3.Another Interface using BAPI, which will, do post goods issue in SAP
    I have to run my outbound interface when the post goods issue is done by all the above three ways.  Can any one help me out in this?

    You have to configure the output first .
    You can use output type LAVA ( avaialble in Std SAP ) .
    ( Tcode is NACE , Select Application V2 -> Outputtypes ).
    ( Create condition records suitable to generate an output)
    Next is ALE.
    Setup a distribution Model ( for DESADV ) and all other setup for ALE i.e. Distribute Dist. Model / Generate Partner Profile .
    In the Partner profile in WE20 select your partner system. Double CLick on Outbound Message DESADV ( this wd be there after you generate partner profile , if not add it here in outbound ) . On this screen goto tab MESSAGE CONTROL .
    Application - V2
    Message Type - LAVA
    Process Code - DELV.
    Now you are ready to go. The moment a PGI is done in any form an output LAVA would be proposed and processed using process code DELV.
    Cheers.

  • Idoc to post goods issue against an outbound delivery

    We happened to simulate both the idocs 'WPUWBW01' and 'MBGMCR02' for posting goods issue for an outbound delivery but failed.
    Request you people to help us on this. Is there another idoc that we have to use to post GI... if so please let us know... and if we are using the right one, guess we are not executing it in the right way... in such a case please guide us with the steps...
    Thanks
    Arun
    We got hold of the Idoc type 'DELVRY03 PGI SHPCON' we are able to post the Idoc but we are able to do the packing only or we are able to change the deliveries but the PGI is not happening..
    please help us on this.. is there some condig that updates the delivery with the PGi or is there something else do be done in the Idoc....
    will provide additional details if required.
    Thanks

    Hi Arun,
    There are no configuration settings in this. It is development that your abaper need to carry out.
    Explain to him that this is the func module. And intrun it has to either trigger a BDC or BAPI for creating packing and PGI.
    He should then do the recording of that and will assign the program pertaining to BDC with in the function module.
    One more suggestion is to put the same query in ABAP section too. U will definitely get a positive response.
    Hope this helps.
    Kind Regards
    Chakradhar

  • One SO but I would like Post Goods Issue from different Storage Locations?

    Dear All,
    Pls help me solve this issue below:
    I have one SO, Item xzy, Qty = 300 but I would like to Post Goods Issue from different Storage Locations (Qty = 100 for each locations)
    E.g I have 3 storage locations: A, B, C and need to assign Post Goods Issue authorizations to 3 users U1, U2, U3:
    - U1 can Post Goods Issue from storage location A only (but cannot from B, C)
    - U2 can Post Goods Issue from storage location B only (but cannot from A, C)
    - U3 can Post Goods Issue from storage location C only (but cannot from A, B)
    How can I assign the Authorization for users?
    How can I create Outbound Delivery:
    a. 1 SO --> 1 outbound delivery --> Post GI 3 times
    b. 1 SO --> 3 outbound delivery --> Post GI
    Thank you very much for your support
    Cao Huy.

    Hi Senthils,
    Pls see my comment below:
    For Authorization check for storage Location
    1. GO to the following Menu path
    Spro>Material Management> Inventory manangement and Physical Inventory>Authorization Management>Authorization check for Storage Location.
    Here you have activate authorization tick for storage location and plant combination.
    --> Done
    2. Set authorization for Authorization object MM_MSEG_LGO thro Basis for the combination of movement type and storage location
    for each user.
    --> Done
    There are 3 storage locations(A,B,C) in one outbound delivery, and when user 01 tries to Post GI this outbound, it means that the system will Post GI for all line items in this outbound, but user 01 has not authorization for location B, C.
    How can user 01 Post GI from only location A in this outbound???
    And then user 02 will Post GI from only location B in this outbound,
    user 03 will Post GI from only location C in this outbound.
    Thanks
    Cao Huy

  • Problem with post goods issue

    hi
    I'm doing a delivery using vl01n bt at post goods issue its showing run time error.the error message details gvn below.
    Information on where terminated
    Termination occurred in the ABAP program "SAPLMBWL" - in
    "MB_POST_GOODS_MOVEMENT".
    The main program was "SAPMV50A ".
    In the source code you have the termination point in line 59
    of the (Include) program "LMBWLU21".
    Source Code Extract
    Line SourceCde
    29 * when a goods movement for an inbound or outbound delivery is posted
    30 * directly from VL31N/ VL01N, XBLNR is not yet known when we call
    31 * CKMV_AC_DOCUMENT_CREATE, but the number is supposed to be stored in
    32 * BKPF as well. There is no other way to forward XBLNR to FI as not
    33 * every document is posted by MB_CREATE -> a new function module in
    34 * MBWL for transferring the information, called by FI, meant to load
    35 * the complete function group for all MBxx postings when this isn't
    36 * required (Performance). Would be the better way to transport the
    37 * information after switching off MBxx in later release.
    38 * corresponding IMPORT ... FROM MEMORY ... can be found in
    39 * AC_DOCUMENT_POST (FORM FI_DOCUMENT_PREPARE (LFACIF5D))
    40 l_mem_id = 'MKPF-XBLNR'. " 641365
    41 EXPORT xblnr = xblnr_sd TO MEMORY ID l_mem_id. " 641365
    42 ENDIF.
    43 IF xmkpf-xabln IS INITIAL. "note 434093
    44 CALL FUNCTION 'MB_XAB_NUMBER_GET'. "note 434093
    45 ENDIF. "note 434093
    46
    47 ENHANCEMENT-POINT MB_POST_GOODS_MOVEMENTS_01 SPOTS ES_SAPLMBWL STATIC.
    48
    49 ENHANCEMENT-POINT MB_POST_GOODS_MOVEMENTS_02 SPOTS ES_SAPLMBWL.
    50 CALL FUNCTION 'MB_CREATE_MATERIAL_DOCUMENT_UT'
    51 EXCEPTIONS
    52 error_message = 4.
    53 * As soon as we have started to put things into UPDATE TASK, we must
    54 * ensure that errors definitely terminate the transaction.
    55 * MESSAGE A is not sufficient because it can be catched from
    56 * external callers which COMMIT WORK afterwards, resulting in
    57 * incomplete updates. Read note 385830 for the full story.
    58 IF NOT sy-subrc IS INITIAL.
    >>>>> MESSAGE ID sy-msgid TYPE x NUMBER sy-msgno WITH "385830
    60 sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    61 * MESSAGE A263.
    62 ENDIF.
    plz tell me the configuration steps for post goods issue in SD if applicable.

    Hi Lakshmipati,
        I have maintained movement type 601 at OMJJ. I hav also added the filed cost center in that (before it was not available).
      I checked GL acct at fs00, it is already contain field status group g004 and the check box "post automaticallyt" is also activated. The cost element has also assigned to cost center. After assigning the cost center to cost element, the error is changed to fld selection for mvmt type 601/ acct 300021 differs for cost center
       But i noticed one thing: If i chage the field status group to g006, the error has not appeared and giving the other error:
    valuation area xxx2 (plant) not yet ptoductive with material ledger this error has been already posted by me but not yet received correct answer.
    Kindly provide the solution for this.
    Regads
    Sabera

  • Post goods issue problem

    Hi,
    We are using program WS_MONITOR_OUTB_DEL_GDSI to post goods issue deliveries in the background. We have this program set up as a background job to run regularly. The problem is that it does not allow you to specify the desired post goods issue date when it is run in the background (in the variant). However if we run it in the foreground you are prompted for the actual post goods issue DATE.
    Are there any other programs / solutions?
    Rgds,
    Finbarr

    Hi Lilly,
    Yes we tried that initally. However the dates in the inital screen of WS_MONITOR_OUTB_DEL_GDSI are for selection criteria only. Unfortunatlelt there is not an option for default GI DATE when you process in the background. I am currently checking OSS but cannot see any relevant notes for this issue in Version 4.7.
    Thanks for you reply,
    Rgds,
    conor

  • Data transfer using ALE/IDOC into XML.

    Dear All,
    I have to transfer FI document data (FB01) from the sap system ,convert it into XML and dump it in 1 of the file servers.I want to do this using ALE/IDOC.Is it possible to do the same and how.Similarly i want to do the same for Vendor and Customer master i.e sending the data in XML format.
    Kindly Suggest how do i go about doin the same..Its very urgent.Please help.
    Thanks & Regards,
    Lailu Philip.

    In continuation:
    Example Purchasing & Selling scenario
    We will develop a custom IDoc to carry the billing number from the Service Receiver’s system to the Service Provider’s system. We will populate the IDoc in a user exit on the sending side and we will process the transaction on the receiving side using a custom function module and a BDC transaction call.
    No rule conversion, segment filtering or version conversion will be implemented in the model as described in Figure 1.
    Requirements
    • Working ALE environment - See ALE Basis Configuration Guide;
    • ALE scenario design together with the business requirement;
    • Development access; and
    • ALE configuration access.
    NOTES:
    1. All IMG references to transactions are located in the transaction SALE which is the ALE portion of the IMG
    2. This is one way of developing a scenario where no message control exists. If message control exist (EG. On purchase orders) then NAST can be used to call an outbound function module that would create the required IDocs.
    3. Extensive knowledge of IDocs and ALE basis configuration is required in order to understand this guide.
    2. OUTBOUND PROCESSING
    2.1. Create IDoc type (WE30) Client independent
    The IDoc type refers to the IDoc structure that you will require for your development. In our case the IDoc type is called ZINVRV01. This IDoc type will have 1 segment called Z1INVRV with 2 fields, LIFNR & XBLNR, in this segment. If you require many segments or nested segments then they are also created using the same procedure.
    We will create the IDoc of the following structure:
    ZINVRV01
    Purchasing and Selling - Invoice receipt reversal
    Z1INVRV P&S - Segment 1
    Segment fields
    LIFNR Vendor account number
    XBLNR Reference document number
    Figure 3: IDoc type ZINVRV01
    To create the IDoc type, follow these next few steps:
    • Enter transaction WE30 (ALE -> Extensions -> IDoc types -> Maintain IDoc type)
    • Type in ZINVRV01 and click on Basic IDoc type, click the Create icon
    • Click on Create new (we are creating an IDoc from scratch but you may want to copy another IDoc if it is similar to your requirements) and enter a description, and press enter
    • Click on ZINVRV01 and then on the Create icon
    • Enter Z1INVRV as the segment type (must start with Z1), check mandatory if the segment must exist (in this case check it), enter 1 in minimum number and 1 as maximum number. (Make the maximum number 9999999999 if there are going to be many of these segments in each IDoc. IE. When line items are passed via IDocs), click on Segment editor
    • Enter a description for your segment type and create
    • Enter a description for your segment, enter each field required in your IDoc, in our case type LIFNR across for Field name, DE structure and DE documentation, repeat for XBLNR and press enter to validate.
    • Save and generate, press back
    • To release the segment choose Goto, Release from the menu
    • Check the box on the line of your new segment
    • Save, back and enter
    • Your IDoc type structure should be displayed with your new segment
    • Save and back
    • To release the IDoc type choose Extras, Release type from the menu and Yes
    Your IDoc is now ready for use. If you need to add fields or segments to your IDoc type, you will need to cancel the release of the IDoc type as well as the segment release using a similar procedure followed above (except now you uncheck the release box for the segment and you choose cancel release for the IDoc type).
    2.2. Create message type (WE81) Client independent
    To create a new message type, follow these next few steps:
    • Enter transaction WE81 (ALE -> Extensions -> IDoc types -> Maintain message type for intermed. Structure -> Create logical message type)
    • Choose Create logical message type by double clicking on it
    • Click on change icon to enter change mode
    • Click on New entries to add a new type
    • Enter the required message type, in our case it is ZINVRV and an appropriate description
    • Save and exit.
    Your message type has now been created. The next step will be to link it to the IDoc.
    2.2.1. Link message to IDoc type (WE82 & BD69) Client independent
    To link the message type to the IDoc type follow these next few steps:
    • Enter transaction WE82 (ALE -> Extensions -> IDoc types -> Maintain message type for intermed. Structure -> EDI: Message Types and Assignment to IDoc Types)
    • Click on change icon to enter change mode
    • Click on New entries to create the link
    • Enter the message type ZINVRV and the BasicIDoc type as ZINVRV01
    • Save and exit
    • Enter transaction BD69 (ALE -> Extensions -> IDoc types -> Maintain message type for intermed. Structure -> Assign message type to IDoc for ALE)
    • Click on change icon to enter change mode
    • Click on New entries to create the link
    • Enter the message type ZINVRV and the BasicIDoc type as ZINVRV01
    • Save and exit
    Your IDoc is now linked to your message type. We still need to link object types and add the message to the model before we can use the message.
    2.2.2. Maintain object type for message type (BD59) Client independent
    The ALE objects are used to create links between IDocs and applications objects, to control the serialisation, to filter messages in the customer model and to use listings.
    For our own message type and IDoc you must maintain object types for the links.
    If you want to check the serialisation for the message type, then you must maintain object types for the serialisation. If no serialisation object has been maintained for a given message type, then the serialisation will not be checked for this message type.
    To add an object type to our message type, follow these next few steps:
    • Enter transaction BD59 (ALE -> Extensions -> ALE object maintenance -> Maintain object types)
    • Type in your message type ZINVRV and press enter
    • Click on New entries
    • Enter your object type, LIFNR (We need to use the vendor as a filter object), the segment name where LIFNR resides, Z1INVRV, a number 1 for the sequence followed by the actual field name LIFNR
    • Save and exit.
    You have now created an object that we’ll use as a filter object in the customer model to direct the flow of messages to the various logical systems based on the vendors in the filter of the message type ZINVRV.
    We now need to add our new message type to the distribution model.
    2.3. Configuring the Distribution Model
    This task is performed on your ALE reference client.
    2.3.1. Manual Configuration (BD64) Client dependent
    To manually configure the customer distribution model, read the ALE configuration procedure, and follow these steps:
    • Perform the Maintain customer distribution model directly function. (ALE -> Distribution customer model -> Maintain customer distribution model directly)
    • Specify the customer model you want to maintain and the logical system that is to be the sender of the messages OR create a new model. (Create model ALE with logical system ALELS1C400)
    • Choose the receiving systems to which the sending system must forward message type ZINVRV to.
    • For each receiving logical system allocate the message type necessary for communication to the receiving systems as per ALE configuration procedure.
    • Create filter objects (in our case LIFNR as the object type with the associated vendor number, 0000018001 with leading zeros, in the object area) for the message types.
    • Save the entries.
    NOTES:
    You cannot maintain a message type between the same sender and receiver in more than one customer distribution model.
    Only the owner is authorised to modify the model.
    To change the owner of a model, choose the 'Maintain ownership of customer distribution model' function. Make sure that all changes will be distributed to all systems that know the corresponding model. To do so, you can use the correction and transport system.
    To transport the customer distribution model you should use the Distribute customer model function of the IMG as described below.
    2.3.2. Distribute customer model (BD71) Client dependent
    After the customer model has been created centrally, it must be distributed to the other remote systems. This entails first of all setting up the communication for the distributed systems and then sending the model.
    2.3.2.1. Distribute Model (BD71) Client dependent
    This task is performed on your ALE reference client. To distribute the customer distribution model, read the ALE configuration procedure and follow these steps:
    • Make the settings for the communication with the other decentral systems, you have not set them yet.
    • Define the RFC destination for R/3 connections whose names correspond to the name of the corresponding logical system.
    • Create the output partner profile.
    • Distribute the customer model
    • Specify the name of the customer model.
    • You must specify the target system to which you want to distribute the customer model.
    • You must repeat this function for every distributed logical system.
    2.3.2.2. Maintain sending system partner profile (WE20) Client dependent
    With this function, you define the partner profiles for all outbound and inbound messages on the basis of the customer distribution model.
    After you have defined and distributed the customer model, you will have to maintain the partner profiles locally. To do this read the ALE configuration procedure.
    • Enter the output mode (background, immediately) and the package size for outbound processing.
    Requirements
    • The customer model must be maintained.
    • RFC destinations must be maintained.
    • The customer model must be distributed.
    • To ensure that the appropriate persons in charge are informed if a processing error occurs, you must make settings in: Error processing Maintain organisational units.
    2.4. Populate & distribute IDoc using ABAP
    An IDoc consists of a control record with structure edidc and one or more data records with structure edidd. The control record contains the sender and recipient of the IDoc, as well as information on the type of message.
    To be able to pass an IDoc to the ALE layer, you must set up a field string with structure edidc and an internal table with structure edidd. They are used to call function module master_idoc_distribute, which performs the save to the database and triggers the dispatch if necessary.
    2.4.1. Example code
    The code displayed below does the following:
    • populates our IDoc segment Z1INVR with the 2 fields XBLNR and LIFNR, populates the segment name and appends this to an internal table used to store the IDoc data;
    • populates the control record info with the message type and IDoc type; and
    • calls the MASTER_IDOC_DISTRIBUTE function module which distributes the IDoc as configured in the customer distribution model.
    Data declaration statements
    DATA: C_INVREV_SEGNAME(7) TYPE C VALUE 'Z1INVRV',
    C_INVREV_MESTYPE(6) TYPE C VALUE 'ZINVRV',
    C_INVREV_IDOC_TYPE(8) TYPE C VALUE 'ZINVRV01',
    Z1INVRV LIKE Z1INVRV,
    C_INVREV_DOCTYPE LIKE BKPF-BLART VALUE 'YY',
    IDOC_CONTROL LIKE EDIDC,
    T_COMM_CONTROL LIKE EDIDC OCCURS 0 WITH HEADER LINE,
    IDOC_DATA LIKE EDIDD OCCURS 0 WITH HEADER LINE.
    Move the document header into a structure
    LOOP AT DOC_HEAD_TAB INTO DOC_HEAD.
    ENDLOOP.
    Move the document item data into a structure
    LOOP AT DOC_ITEM_TAB INTO DOC_ITEM WHERE NOT ( LIFNR IS INITIAL ).
    ENDLOOP.
    Populate the IDoc segment’s field with the required data
    CLEAR Z1INVRV.
    Z1INVRV-LIFNR = DOC_ITEM-LIFNR. “Store vendor number for filter
    Z1INVRV-XBLNR = DOC_HEAD-XBLNR. “Billing number
    IDOC_DATA-SEGNAM = C_INVREV_SEGNAME. “Segment name
    IDOC_DATA-SDATA = Z1INVRV. “Segment data
    APPEND IDOC_DATA. “Populate IDoc internal table
    Move the control data info required for the distribution
    IDOC_CONTROL-MESTYP = C_INVREV_MESTYPE.
    IDOC_CONTROL-DOCTYP = C_INVREV_IDOC_TYPE.
    Call the distribute function with the required parameters
    CALL FUNCTION 'MASTER_IDOC_DISTRIBUTE' IN UPDATE TASK
    EXPORTING
    MASTER_IDOC_CONTROL = IDOC_CONTROL
    TABLES
    COMMUNICATION_IDOC_CONTROL = T_COMM_CONTROL
    MASTER_IDOC_DATA = IDOC_DATA
    EXCEPTIONS
    ERROR_IN_IDOC_CONTROL = 1
    ERROR_WRITING_IDOC_STATUS = 2
    ERROR_IN_IDOC_DATA = 3
    SENDING_LOGICAL_SYSTEM_UNKNOWN = 4
    OTHERS = 5.
    Figure 4: Outbound processing example code
    NOTE:
    For debugging purposes, use transaction WE05 (IDoc overview) to see check your IDoc status, or to see whether an IDoc was created/
    3. INBOUND PROCESSING
    3.1. Create Function Module
    This function module is called when a message type, of type ZINVRV, comes into the receiving system. This needs to be configured and is dealt with later in this section. The function module is passed the IDoc as a parameter.
    Example parameters
    Import parameters Reference field Opt Y/N
    INPUT_METHOD BDWFAP_PAR-INPUTMETHD N
    MASS_PROCESSING BDWFAP_PAR-MASS_PROC N
    Export Parameters Reference field Opt Y/N
    WORKFLOW_RESULT BDWFAP_PAR-RESULT N
    APPLICATION_VARIABLE BDWFAP_PAR-APPL_VAR N
    IN_UPDATE_TASK BDWFAP_PAR-UPDATETASK N
    CALL_TRANSACTION_DONE BDWFAP_PAR-CALLTRANS N
    Table Parameters Reference field Optional Y/N
    IDOC_CONTRL EDIDC
    IDOC_DATA EDIDD
    IDOC_STATUS BDIDOCSTAT
    RETURN_VARIABLES BDWFRETVAR
    SERIALIZATION_INFO BDI_SER
    Exceptions
    WRONG_FUNCTION_CALLED
    Example code
    The code displayed below does the following:
    • populates a BDC table with the IDoc info;
    • calls the transaction via a BDC call; and
    • updates the IDoc status according to the BDC error status.
    EXTRACT FROM: Z_IDOC_INPUT_ZINVRV
    Declaration of local variables
    DATA: C_SEGNAM(10) TYPE C VALUE 'Z1INVRV'.
    *-Loop through the IDOCs
    LOOP AT IDOC_CONTRL.
    *---Loop through the data for the IDOC
    LOOP AT IDOC_DATA WHERE DOCNUM = IDOC_CONTRL-DOCNUM.
    CASE IDOC_DATA-SEGNAM.
    WHEN C_SEGNAM.
    Here we get the info from the idoc table
    IT_Z1INVRV = IDOC_DATA-SDATA.
    ENDCASE.
    PERFORM REV_INV.
    ENDLOOP.
    PERFORM UPDATE_IDOC_STATUS.
    ENDLOOP.
    FORM REV_INV "Reverse invoice form
    Local variables & constants
    DATA: C_TCODE LIKE BKPF-TCODE VALUE 'VF11'. "BDC transaction code
    Now we can build the bdc table to call the reversal transaction start of screen 109
    CLEAR BDC_TAB.
    BDC_TAB-PROGRAM = 'SAPMV60A'.
    BDC_TAB-DYNPRO = '109'.
    BDC_TAB-DYNBEGIN = 'X'.
    APPEND BDC_TAB.
    Document number
    CLEAR BDC_TAB.
    BDC_TAB-FNAM = 'KOMFK-VBELN(01)'.
    BDC_TAB-FVAL = IT_Z1INVRV-XBLNR. "Billing document number
    APPEND BDC_TAB.
    OK Code for screen 109
    CLEAR BDC_TAB.
    BDC_TAB-FNAM = 'BDC_OKCODE'.
    BDC_TAB-FVAL = 'SICH'.
    APPEND BDC_TAB.
    Now we can call transaction 'VF11' with the populated bdc table. The transaction is called inside the idoc-contrl loop, so a transaction will be called for every idoc (journal). the transaction is called in no-display mode ('N') because this code runs in background as it is called by ale. The update is specified to be synchronous ('S') because we have to wait for the result to update the idoc status correctly.
    CALL TRANSACTION C_TCODE USING BDC_TAB MODE 'N' UPDATE 'S'.
    Store the return code for use in another form (status update)
    RETURN_CODE = SY-SUBRC.
    Here we check the return code, if there was an error, we put the transaction in a bdc session for the user to review and correct.
    IF SY-SUBRC NE 0.
    CALL FUNCTION 'BDC_OPEN_GROUP'
    EXPORTING
    CLIENT = SY-MANDT
    GROUP = 'ZINVRV'
    USER = C_ALE_USER
    KEEP = 'X'.
    CALL FUNCTION 'BDC_INSERT'
    EXPORTING
    TCODE = C_TCODE
    TABLES
    DYNPROTAB = BDC_TAB.
    CALL FUNCTION 'BDC_CLOSE_GROUP'
    EXCEPTIONS
    NOT_OPEN = 1
    QUEUE_ERROR = 2
    OTHERS = 3.
    ELSE. "No problems
    C_EXISTS = 'N'.
    Select from the billing document table to get sales doc number
    SELECT * FROM VBRP WHERE VBELN = IT_Z1INVRV-XBLNR.
    Select from the sales document table to get user status number
    SELECT SINGLE * FROM VBAP WHERE VBELN = VBRP-AUBEL AND
    POSNR = VBRP-AUPOS.
    Select from the status table to change the user status to pending
    SELECT * FROM JEST WHERE OBJNR = VBAP-OBJNR AND
    STAT LIKE C_USER_STATUS.
    IF JEST-STAT = C_US_PENDING. "User status is pending
    JEST-INACT = C_UNCHECKED. "Make pending the active status
    UPDATE JEST.
    C_EXISTS = 'Y'. "I.E. An entry is already in table
    ELSEIF JEST-INACT = C_UNCHECKED AND JEST-STAT NE C_US_PENDING.
    JEST-INACT = C_CHECKED. "Make everything else inactive
    UPDATE JEST.
    ENDIF.
    ENDSELECT.
    IF C_EXISTS = 'N'. "I.E. Pending has never been a status before
    JEST-OBJNR = VBAP-OBJNR.
    JEST-STAT = C_US_PENDING.
    JEST-INACT = C_UNCHECKED. "Make pending the active status
    INSERT JEST.
    ENDIF.
    ENDSELECT. "Select from VBRP (Billing document table)
    ENDIF.
    ENDFORM. " REV_INV
    FORM UPDATE_IDOC_STATUS.
    Now we check the CALL TRANSACTION return code and set IDOC status
    CLEAR IDOC_STATUS.
    IF RETURN_CODE = 0.
    WORKFLOW_RESULT = '0'.
    IDOC_STATUS-DOCNUM = IDOC_CONTRL-DOCNUM.
    IDOC_STATUS-STATUS = '53'.
    IDOC_STATUS-UNAME = SY-UNAME.
    IDOC_STATUS-REPID = SY-REPID.
    IDOC_STATUS-MSGTY = SY-MSGTY.
    IDOC_STATUS-MSGID = SY-MSGID.
    IDOC_STATUS-MSGNO = SY-MSGNO.
    IDOC_STATUS-MSGV1 = SY-MSGV1.
    IDOC_STATUS-MSGV2 = SY-MSGV2.
    IDOC_STATUS-MSGV3 = SY-MSGV3.
    IDOC_STATUS-MSGV4 = SY-MSGV4.
    RETURN_VARIABLES-WF_PARAM = 'Processed_IDOCs'.
    RETURN_VARIABLES-DOC_NUMBER = IDOC_CONTRL-DOCNUM.
    APPEND RETURN_VARIABLES.
    ELSE.
    WORKFLOW_RESULT = '99999'.
    IDOC_STATUS-DOCNUM = IDOC_CONTRL-DOCNUM.
    IDOC_STATUS-STATUS = '51'.
    IDOC_STATUS-UNAME = SY-UNAME.
    IDOC_STATUS-REPID = SY-REPID.
    IDOC_STATUS-MSGTY = SY-MSGTY.
    IDOC_STATUS-MSGID = SY-MSGID.
    IDOC_STATUS-MSGNO = SY-MSGNO.
    IDOC_STATUS-MSGV1 = SY-MSGV1.
    IDOC_STATUS-MSGV2 = SY-MSGV2.
    IDOC_STATUS-MSGV3 = SY-MSGV3.
    IDOC_STATUS-MSGV4 = SY-MSGV4.
    RETURN_VARIABLES-WF_PARAM = 'ERROR_IDOCS'.
    RETURN_VARIABLES-DOC_NUMBER = IDOC_CONTRL-DOCNUM.
    APPEND RETURN_VARIABLES.
    ENDIF.
    APPEND IDOC_STATUS.
    ENDFORM. " UPDATE_IDOC_STATUS
    Figure 5: Inbound processing example code
    3.1.1. Debugging inbound FM
    Use transaction WE19 to test inbound function module in debugging mode. Also use WE05 to view the IDocs and their statuses.
    3.2. Maintain ALE attributes
    The inbound function module needs to be linked to the message type and the message type needs to be linked to the appropriate inbound process code at the partner profile level before the scenario is enabled. These steps are described below in detail.
    3.2.1. Link Message Type to Function Module (WE57) Client independent
    To link a message (ZINVRV) type to a function module (Z_IDOC_INPUT_ZINVRV) follow these steps:
    • Enter transaction WE57 (ALE -> Extensions -> Inbound -> Allocate function module to logical message)
    • Select an entry (EG. IDOC_INPUT_ORDERS) and copy
    • Type in module name Z_IDOC_INPUT_ZINVRV
    • Type in basic IDoc type as ZINVRV01
    • Type in message type as ZINVRV
    • Type object type as IDOCINVOIC (Invoice document) - Used for workflow
    • Direction should be set to 2 for inbound
    • Enter and save
    3.2.2. Define FM settings (BD51) Client independent
    • Enter transaction BD51 (ALE -> Extensions -> Inbound -> Define settings for input modules)
    • Click on New entries
    • Type in the name of the new function module Z_IDOC_INPUT_ZINVRV
    • Enter 0 for mass processing in the output column
    • Save and Exit
    3.2.3. Maintain process codes (WE42) Client dependent
    A process code needs to be maintained on each client. It then needs to be linked to the message via the partner profiles on each client. This allows the various clients to use a unique function module for the same message type.
    To maintain the process code follow these steps:
    • Log on to the appropriate receiving system client
    • Execute WE42 (ALE -> Extensions -> Inbound -> Maintaining process codes inbound)
    • Choose Inbound with ALE service
    • Choose Processing with function module
    • Click on Processing with function module and choose create icon
    • Click on New Entries
    • Type in process code ZINR and give it a description and save
    • Now you are asked to Please maintain codes added in ALE entry methods, enter and choose Z_IDOC_INPUT_FIRVSL and copy it. You should choose a FM similar to your one.
    • Enter your process code ZINR
    • Enter your function module Z_IDOC_INPUT_ZINVRV
    NOTE: The next 6 steps are used in workflow error handling.
    • Enter IDPKFIDCMT in object type
    • Enter MASSINPUTFINISHED in End event
    • Enter IDOCINVOIC in IDoc object type
    • Enter INPUTERROROCCURREDFI in IDoc start event
    • Enter INPUTFINISHEDFI in IDoc End event
    • Enter IDOCINVOIC in Application object type
    You will need to determine the task associated with object IDOCINVOIC, and then assign the appropriate position to it. This position will then receive the application error messages via workflow.
    To set up the workflow area please consult the Workflow config guide.
    3.3. Create inbound partner profile
    For each message type you need to maintain the inbound partner profiles.
    3.3.1. Maintain receiving system partner profile (WE20) Client dependent
    To maintain inbound partner profiles read the document ALE configuration procedure:
    • Add the message type ZINVRV with process code ZINR.
    • Enter the output mode (background, immediately) for inbound processing and NO message code.
    • Enter the position S and choose the ALE administrator 50000085. This position will then receive all the technical ALE errors via workflow.
    3.4. Test
    Once the inbound function module has been debugged the scenario should be ready to test in its entirety. If problems occur, read through the relevant areas of this document to check your configuration or code.
    Hope this will help you,
    If you  want me to explain more, you can give me your email id.
    Reward with points incase you are satisfied.
    Regards,
    Sushama

  • Problem in creating Invoice receipt using ALE-IDoc?

    Hi all,
    I implemented the auto creation of invoice receipt when billing document created using ALE-Idoc. It is working fine in PRD also.
    But today , there occurred a problem in this . The problem is  when the billing document is created the Invoice receipt is not creating directly , but a job is creating. But till yesterday it created the invoice receipt immediately as we required.
    So please help me on changing the creation of invoice receipt directly from current job creation? 
    No configuration has been changed ,  but my user tried to create the more than one billing document at a time.so i think  this is the reason for it. But now though he is creating only  one billing document , it is creating a job.
    Please reply ASAP.
    Thanks,
    Vamshi.

    Solved .

  • Help on IDOC -POST GOODS ISSUE

    Hi Folks,
               I have requirement with me, but I don’t know where to start could you please help me regarding that..
    Here is the scenario....
    Requirement Specification:
    XYZ Company Mexico operations  uses third party systems Foursite) for their inventory process.
    The communication between Foursite and SAP is thru EDI/IDOC.
    In the case of goods customer return to Mexico warehouse, using the following steps the process will be mapped in to SAP.
    Customer calls the account specialist.
    Account specialist creates a ZO order in SAP and conveys a RA to customer.
    Account specialist creates a delivery. The delivery information conveyed to Mexico warehouse thru Inbound receipt IDOC.
    Customer physically returns the goods to Mexico warehouse.
    Mexico warehouse receive the goods with reference to delivery number in Inbound receipt IDOC.
    Once the goods are received, Mexico warehouse send a conformation (Receipt confirmation IDOC) to SAP, which triggers PGI and credit memo.
    Functional Specifications:
    Create POST GOODS ISSUE in SAP for the material and quantity for the delivery mentioned in Receipt conformation EDI.
    Receipt confirmation from Foursite
    Data fields received in the EDI
    Delivery number:LIKP-VBELN
    Material number::LIPS-MATNR
    Quantity:LIPS-LFIMG
    Unit LIPS-MEINS
    Plant :DMEX
    Status  :RS
    Possible IDOC:  SDPICK
    Trigger:
    This IDOC should trigger a Post good issue, for the possible values.
    Transaction: Post good issue.
    Please give ur input /suggestion , What steps I should take to get it complete .
    Thanks in Advance..
    Bye and have a good one .

    Somnath,
    If I understand the right, it is like a integration using EDI formats. Do you have a middleware in place to do the mapping transformation? If yes, the message in EDI format will be recieved by the middleware and will be transformed into IDOC format.
    Then you do the normal settings for an IDOC to be recieved into a SAP system (Partner Profiles, Inbound Messages etc).
    Is this what you were looking for?
    Regards,
    Ravi
    Note : Please reward the posts that help you.

  • Create credit memo request using inbound IDOC

    Hi Experts,
    I want to create credit memo request using inbound IDOC, currently I am using GSVERF03 basic type and process code GSVE, I am getting below error:
    No records exist in T661W for vendor XXXXX, plant, unloading point
    Anyone suggest me is this correct message type to create credit memo request or suggest me the correct one. because we are working with customer sales order and invoice not with vendor purchase order.
    Thanks for your help.

    ah, apologies i read outbound! I think you are using the correct message type i.e. GSVERF.
    Can you not simply create the missing entry in T661W? i.e. for the missing records?

  • Issue in transporting changed material type using ALE-IDOC

    Hi All,
    I am sending the material master data from one system to another using ALE-IDOC.The issue is that teh material type is not getting sent from one system to another after changing the material type.I mean the changes in material type are not getting updated.I will be indeed thankful if anyone can guide me resolve this issue.
    Thanks.

    Hi,
    Not all the fields that are changed in material master are sent in the Idoc. Material type is one such field.
    Create change pointer on some other field ex. net value or material desc. and transfer the material type changes under it.
    KR Jaideep,

  • Integrating SAP CRM with the SAP HR module using ALE/IDOC

    Hi,
    We replicated HR data(employee and position) from SAP HR to SAP CRM system using ALE/IDOC.
    Here I have one question,If I change the position to the employee in CRM system,will changes happen in SAP HR system automatically? or Delta changes will haapen? If yes pl explain.
    Using change pointers master data changes flowsfrom SAP HR to SAP CRM .
    TIA.
    PV.

    Hi
    To integrate... between those systems
    first of all u have to create message type to tose fields with t code bd52.
    then activate that massege type in bd50.
    and after that one u have to activate chaneg pointers globally with bd61.
    if u did these thigns if u made any chnegs to those fileds that witll be reflected in the next system
    Regards,
    Prasad.

  • Lsmw using ALE/IDOC Method

    Hi Team,
    I am trying for lsmw using ALE/IDOC Method.
    I have defined the segment type, message type, defined a basic type and defined a partner profile of the receiver system.
    When i try to execute the Start Idoc Generation step in generating LSMW creation steps. I am getting below error "No partner exists with the nae ", type".
    Please help me in resolving the warining.
    No partner exists with the name '', type ''
    Regards
    Sunil
    Edited by: sunil kumar on Jul 30, 2009 11:26 AM

    Hi,
    for LSMW , you have to create partner profile type as 'US'.
    once the partner profile created in we20,
    goto tcode  lsmw , in menu select "Settings -> Inbound Idoc Processing"
    maintain FilePort, partner type and Partner number and then press Activiate Idoc Inbound pricessing.
    Then you will not get this error message.
    Regards,
    Bhavana

  • Passing Changed  extended fields using ALE-IDOC to receiving system

    Hi all,
    Please tell me how passing changed  extended fields using ALE-IDOC to receiving system can be achieved. Is it possible by Chnage pointer concept.Do i need to do some coading after data enters into receiving system as it is required while creating the entries in database table.
    For ex. in matmas05 extended for classification and inspection view and then created using 'CREATION'
    related bapi.Do i also need to incorporate the changes by change related bapi or ir can be handled by change pointer concept.
    Thanks.

    Hi Sanu
    1) Please tell me how passing changed extended fields using ALE-IDOC to receiving system can be achieved. Is it possible by Chnage pointer concept.
    => Looks like you have extended standard IDOC here. so you need to find User Exit or BADI for the Push program to populate the additional fields. Yes, it is possible thru change pointers as well.
    1) Do i need to do some coading after data enters into receiving system as it is required while creating the entries in database table.
    => Yes, as suggested in 1 try finding User Exits/BADIs.
    Regards
    Shital

  • Posting goods issue using Message type SHPCON and idoc type DELVRY03

    Hi SAP Gurus,
    I am using message type SHPCON and idoc type DELVRY01 with processing code DELV to post goods issue for a delivery note.
    I tried to simulate the inbound entry via WE19. The scenario should be posting goods issue based on the delivery order.
    In some cases, quantity issued is less than the quantity in the DO. For this, I need to change the delv quantity in the DO via VL02N before I select Post goods issue button. This will change at the same time post the goods issue.
    What I have filled up are the fields:
    E1EDL20-VBELN = DO num
    E1EDL20-VSTEL = Plant
    E1EDL18-QUALF = "PGI"
    E1EDTH13-QUALF = "006"
    E1EDTH13-NTANF = date today
    E1EDL24-POSNR = 000010
    E1EDL24-MATNR = material num
    E1EDL24-WERKS = delv plant
    E1EDL24-LGORT = sloc
    E1EDL24-LFIMG = updated quantity
    But everytime I simulate using WE19, the entire quantity in the DO is not changed at all. The goods issue quantity posted is still the original DO quantity.
    May I know how to do this? Thanks.

    Put value in E1EDL24-LGMNG for qty to pgi.

Maybe you are looking for