Value mapping not working properly

Hi All,
I am using value mapping twice in same mapping program. But only 1 field is coming with value and other is taking same value from source payload, can you please tell me what can be issue here?
Value mapping 1 -
Context - http://sap.com/xi/XI
SenderParty- SenderSchema
ReceiverParty- ReceiverSchema
Value Mapping table in ID -
Value mapping at field 2 -
Context - http://sap.com/xi/XI
SenderParty1- SenderSchema1
ReceiverParty2- ReceiverSchema2
Value Mapping table in ID -
Source payload -
<?xml version="1.0" encoding="UTF-8"?>
<ns0:MT_VM_Send xmlns:ns0="http://xyz.com/Rashmi_CollectPatternDemo">
   <Record>
      <Emp_ID>123</Emp_ID>
      <Name>rash</Name>
      <Surname>sumit</Surname>
      <Gender>Male</Gender>
     <Grade>E2</Grade>
  </Record>
</ns0:MT_VM_Send>
Target Payload -
<?xml version="1.0" encoding="UTF-8"?>
<ns0:MT_VM_Receiver xmlns:ns0="http://xyz.com/Rashmi_CollectPatternDemo">
<Record>
<Emp_ID>123</Emp_ID>
<Full_Name>rash sumit</Full_Name>
<Designation>E2</Designation>
<Gender>M</Gender>
<Travel_Mode>Train</Travel_Mode>
</Record>
</ns0:MT_VM_Receiver>
Here travel_mode is coming perfect, but designation is same as defined in source payload. Why here Value mapping not working???
Thanks & regards,
Rashmi Joshi

Hi Rashmi,
The problem would either be in cache update or your mapping. Please provide the sceenshot of mapping (after clicking the value mapping function).
you can also choose the option to throw error in value mapping function, so it will throw error when value not found.
regards,
Harish

Similar Messages

  • Value mapping -----Not working?

    Hi experts,
    I have craeted value mapping in integartion directory.
    But the target values are not getting reflected.
    I checked the mapping in runtime and its showing exact target value.
    The data volume is huge in the mapping ( say 600) .Is it because of this volume...am i facing the error.
    The target and sorce schema are perfect...
    Coversion Example:
    Source -ABCCBB
    Expected target value -1345
    Result target value-ABCCBB( now coming in system)
    Thanks in advance for your help.

    Hi Anil,
    Generally in Value Mapping, when a target value is not given for a corresponding source value, the source value itself is sent to the target field.
    Please check if you have grouped properly.
    Thanks,
    Jaya

  • "Maps" not working properly after 10.3.2.440 update.

    I rec'd my 10.3.2.440 update Sunday night.  Everything seems to be working except Maps.  Maps will open, but I get a message on screen like, "Content Unavailable.  My Places content is currently unavailable."  The map opens, and finds my present position, but I can't search for addresses, stores, or anything else.  If I manually type in an address, it may find it, but it won't calculate directions.  Any help would be appreciated! D Wells

    Hi there! @Dwells2009  
    Thanks for posting your concerns. I’m sorry to hear you’ve had issues with the Maps app.
    I’d recommend trying a soft reset by pulling the battery from the phone for 2-3 minutes.
    If this does not clear the issue, you will want to back up your data and factory reset the phone.
    For steps to factory reset your phone, please go to http://www.att.com/devicehowto/ and select the make and model of your phone. Once you have done this, locate Troubleshooting in the left column and select the + symbol then click on Reset Device for full back up and reset instructions.
    Hope this helps!
    Charise

  • Google maps not working properly

    Has anyone else noticed this recently. Google maps does not seem to (or incorrectly) locates the wrong addresses from my contacts. It worked fine a week ago. I have noticed on some of the contacts, google will change the address during the search or can't find the address, including my home address which it identified perfectly before. Is this a software issue with google, or an iphone issue? Also in the past when I used goog 411 (free directory), it would send a text with the phone number and a map link so that I could locate the place I got the phone number for. The link does not seem to find the location anymore on the map. I really liked this feature.

    I'm glad someone asked this question!!!  I'm dealing with the same crap...

  • Power Map not working properly

    Hi all
    I have worked sporadically with Power Map since the first GeoFlow non-public beta.
    Now i have upgraded to the new bits, with both Power Query and Power Map, but my Power Map isn't functioning.
    When i plot some data i can se a lot of grey Squares appearring, representing the locations, so the data is being geo coded correctly from Bing, but when i add a measure and expect to see the bars rising on the map, nothing happens.
    I have tried on my primary laptop, on a completely newly installed Windows 8 with Office 365 ProPlus and on a newly installed Windows 8 with Office 2013 Professional Plus - all with same result.
    I really need to have a working demo environment up and running, so any help would be appreciated.
    BR David
    Regards David

    Hello again,
    We recently released an updated Power Map
    preview that now includes VM support. Give it a try!
    That said, you mentioned that you're running Parallels and I haven't been able to find confirmation that current versions of Parallels officially support DirectX 10 (which is a system requirement for Power Map). I found a Parallels forum
    post saying that Parallels Desktop 8 includes experimental support for DirectX 10 but the current Parallels Desktop 9 landing
    page still references DirectX 9. Your mileage may vary. Good luck!
    I hope this helps!
    Blair Neumann (MSFT)

  • In my MacBook Pro Maps app not working properly?.. any solution

    Maps app not working properly?.. any solution

    If i search any routes by clicking directions tab,the message shows like this " DIRECTIONS ARE NOT AVAILABLE A ROUTE TO THE DESTINATION FROM ITS NEAREST ROAD CANNOT BE DETERMINED"

  • Pick List Value Not Working Properly

    Hi Oracle Framework Gurus,
    I have a strange Issue in which one of my cusom page is working properly in Jdev and not working Properly when deployed in the apps instance.
    There are two custom pages with the same VO.
    What I do is have a picklist from one of the custom page and depending on the value of the picklist and I navigate to the other custom page.
    This is working properly in the JDev,But for some reasons it works properly in apps instance, when I try to run the first time(ie) when I run page A and pick 'X' from the picklist the Page 'B' is coming properly as per the controller code and when i pick 'Y' from the picklist in Page B, it is navigating to Page A as per the controller code.
    This works fine for the first time,But when i again select 'X' from the picklist the proper value from the Picklist is not getting selected and passed to the custom package and so I get wrong values in Page 'B'
    What could be the reason for it as it working fine in Jdev,I can navigate from Page A to Page B and Page B to Page A as many times possible.

    Hi Anand,
    Controller1 :
    public void processRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processRequest(pageContext, webBean);
    //int intPersonId = pageContext.getEmployeeId();
    int intPersonId; // = pageContext.getEmployeeId();
    String strPersonId = Integer.toString(277671);
    //String strPersonId = Integer.toString(intPersonId);
    java.util.Date sysdate = pageContext.getCurrentUserDate();
    String convSysDate = pageContext.getOANLSServices().dateToString(sysdate);
    // Date testdate = (Date)sysdate.dateValue();
    // get the Application Module
    OAApplicationModule oaAM = pageContext.getApplicationModule(webBean);
    Serializable parameters[] = { strPersonId,convSysDate };
    Serializable param[] = { strPersonId };
    System.out.println("The Sysdate PF "+convSysDate);
    //pass parameters to Application Module
    oaAM.invokeMethod("insertLovRow", param);
    if ((String)pageContext.getSessionValue("PFlag1") != null)
    String PFlag1 =(String)pageContext.getSessionValue("PFlag1");
    String SDate1 =(String)pageContext.getSessionValue("SDateSession1");
    Serializable param1[] = { SDate1 };
    oaAM.invokeMethod("insertLovRow", param);
    oaAM.invokeMethod("initEmpLovQuery1",param1);
    oaAM.invokeMethod("initEmpTransLovQuery1");
    OAMessageChoiceBean orgMesgChoiceBean = (OAMessageChoiceBean)webBean.findChildRecursive("Year");
    orgMesgChoiceBean.setPickListViewObjectDefinitionName("EmployeeTest.oracle.apps.per.server.EmpTransDateLov");
    orgMesgChoiceBean.setListValueAttribute("StartDate");
    orgMesgChoiceBean.setListDisplayAttribute("DateRange" );
    orgMesgChoiceBean.setPickListCacheEnabled(false);
    else
    oaAM.invokeMethod("insertRow", parameters);
    oaAM.invokeMethod("initQuery", param);
    oaAM.invokeMethod("execQuery");
    oaAM.invokeMethod("totexecQuery");
    OAMessageChoiceBean orgMesgChoiceBean = (OAMessageChoiceBean)webBean.findChildRecursive("Year");
    orgMesgChoiceBean.setPickListViewObjectDefinitionName("EmployeeTest.oracle.apps.per.server.EmployeeDateLovVO");
    orgMesgChoiceBean.setListValueAttribute("StartDate");
    orgMesgChoiceBean.setListDisplayAttribute("DateRange" );
    orgMesgChoiceBean.setPickListCacheEnabled(false);
    oaAM.invokeMethod("initEmpLovQuery");
    OAViewObject oaviewobject1 =(OAViewObject)oaAM.findViewObject("EmployeeUtilVO1");
    oaviewobject1.reset();
    if (oaviewobject1 != null)
    do
    if(!oaviewobject1.hasNext())
    break;
    oaviewobject1.next();
    OARow row = (OARow)oaviewobject1.getCurrentRow();
    String fullName = (String)row.getAttribute("EmpDep");
    System.out.println("The Name is "+fullName);
    } while(true);
    * Procedure to handle form submissions for form elements in
    * a region.
    * @param pageContext the current OA page context
    * @param webBean the web bean corresponding to the region
    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processFormRequest(pageContext, webBean);
    //int intPersonId = pageContext.getEmployeeId();
    //String strPersonId = Integer.toString(intPersonId);
    int intPersonId; // = pageContext.getEmployeeId();
    String strPersonId = Integer.toString(277671);
    OAApplicationModule oaAM = pageContext.getApplicationModule(webBean);
    if (pageContext.getParameter("ViewDetails") != null)
    pageContext.putSessionValue("strPersonId", strPersonId);
    pageContext.setForwardURL("OA.jsp?page=/EmployeeTest/oracle/apps/per/webui/EmployeePanelIB",
    null,
    OAWebBeanConstants.KEEP_MENU_CONTEXT,
    null,
    null,
    true, // Retain AM
    OAWebBeanConstants.ADD_BREAD_CRUMB_YES, // Show breadcrumbs
    OAWebBeanConstants.IGNORE_MESSAGES);
    System.out.println("strPersonId "+strPersonId);
    String strEvent= pageContext.getParameter(EVENT_PARAM) ;
    if ( strEvent.equals("update"))
    OAMessageChoiceBean DepStatus1 = (OAMessageChoiceBean) webBean.findIndexedChildRecursive("Year");
    String sDate = DepStatus1.getSelectionValue(pageContext);
    //String sDate = DepStatus1.getValue(pageContext).toString();
    //Serializable parameters[] = { strPersonId,sDate };
    Serializable parameters[] = { strPersonId,sDate };
    Serializable param[] = { strPersonId };
    System.out.println("The PersonId "+strPersonId);
    System.out.println("The Controller Date passed is IBUtil "+sDate);
    oaAM.invokeMethod("insertRow", parameters);
    oaAM.invokeMethod("initQuery", param);
    oaAM.invokeMethod("execQuery");
    String flag = "1";
    //pageContext.putSessionValue("strPersonId", strPersonId);
    pageContext.putSessionValue("PFlag", flag);
    pageContext.putSessionValue("SDateSession", sDate);
    pageContext.setForwardURL("OA.jsp?page=/EmployeeTest/oracle/apps/per/webui/EmpTestPG",
    null,
    OAWebBeanConstants.KEEP_MENU_CONTEXT,
    null,
    null,
    true, // Retain AM
    OAWebBeanConstants.ADD_BREAD_CRUMB_YES, // Show breadcrumbs
    OAWebBeanConstants.IGNORE_MESSAGES);
    Controller 2:
    public void processRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processRequest(pageContext, webBean);
    //int intPersonId = pageContext.getEmployeeId();
    int intPersonId; // = pageContext.getEmployeeId();
    String strPersonId = Integer.toString(277671);
    //String strPersonId = Integer.toString(intPersonId);
    java.util.Date sysdate = pageContext.getCurrentUserDate();
    String convSysDate = pageContext.getOANLSServices().dateToString(sysdate);
    // get the Application Module
    OAApplicationModule oaAM = pageContext.getApplicationModule(webBean);
    Serializable parameters[] = { strPersonId,convSysDate };
    Serializable param[] = { strPersonId };
    System.out.println("The Sysdate PF "+convSysDate);
    //pass parameters to Application Module
    oaAM.invokeMethod("insertLovRow", param);
    if ((String)pageContext.getSessionValue("PFlag") != null)
    String PFlag1 =(String)pageContext.getSessionValue("PFlag");
    String SDate1 =(String)pageContext.getSessionValue("SDateSession");
    Serializable param2[] = { strPersonId, SDate1 };
    Serializable param1[] = { SDate1 };
    oaAM.invokeMethod("insertLovRow", param);
    oaAM.invokeMethod("initEmpLovQuery1",param1);
    oaAM.invokeMethod("initEmpTransLovQuery1");
    OAMessageChoiceBean orgMesgChoiceBean = (OAMessageChoiceBean)webBean.findChildRecursive("Year");
    orgMesgChoiceBean.setPickListViewObjectDefinitionName("EmployeeTest.oracle.apps.per.server.EmpTransDateLov");
    orgMesgChoiceBean.setListValueAttribute("StartDate");
    orgMesgChoiceBean.setListDisplayAttribute("DateRange" );
    orgMesgChoiceBean.setPickListCacheEnabled(false);
    else
    oaAM.invokeMethod("insertRow", parameters);
    oaAM.invokeMethod("initQuery", param);
    oaAM.invokeMethod("execQuery");
    oaAM.invokeMethod("totexecQuery");
    OAMessageChoiceBean orgMesgChoiceBean = (OAMessageChoiceBean)webBean.findChildRecursive("Year");
    orgMesgChoiceBean.setPickListViewObjectDefinitionName("EmployeeTest.oracle.apps.per.server.EmployeeDateLovVO");
    orgMesgChoiceBean.setListValueAttribute("StartDate");
    orgMesgChoiceBean.setListDisplayAttribute("DateRange" );
    orgMesgChoiceBean.setPickListCacheEnabled(false);
    oaAM.invokeMethod("initEmpLovQuery");
    OAViewObject oaviewobject1 =(OAViewObject)oaAM.findViewObject("EmployeeUtilVO1");
    oaviewobject1.reset();
    if (oaviewobject1 != null)
    do
    if(!oaviewobject1.hasNext())
    break;
    oaviewobject1.next();
    OARow row = (OARow)oaviewobject1.getCurrentRow();
    String fullName = (String)row.getAttribute("EmpDep");
    System.out.println("The Name is "+fullName);
    } while(true);
    * Procedure to handle form submissions for form elements in
    * a region.
    * @param pageContext the current OA page context
    * @param webBean the web bean corresponding to the region
    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processFormRequest(pageContext, webBean);
    OAApplicationModule oaAM = pageContext.getApplicationModule(webBean);
    //int intPersonId = pageContext.getEmployeeId();
    //String strPersonId = Integer.toString(intPersonId);
    int intPersonId; // = pageContext.getEmployeeId();
    String strPersonId = Integer.toString(277671);
    if (pageContext.getParameter("ViewDetails") != null)
    pageContext.setForwardURL("OA.jsp?page=/EmployeeTest/oracle/apps/per/webui/EmpPanelPG",
    null,
    OAWebBeanConstants.KEEP_MENU_CONTEXT,
    null,
    null,
    true, // Retain AM
    OAWebBeanConstants.ADD_BREAD_CRUMB_YES, // Show breadcrumbs
    OAWebBeanConstants.IGNORE_MESSAGES);
    pageContext.putSessionValue("strPersonId", strPersonId);
    String strEvent= pageContext.getParameter(EVENT_PARAM) ;
    if ( strEvent.equals("update"))
    OAMessageChoiceBean DepStatus1 = (OAMessageChoiceBean) webBean.findIndexedChildRecursive("Year");
    String sDate = DepStatus1.getSelectionValue(pageContext);
    //String sDate = DepStatus1.getValue(pageContext).toString();
    Serializable parameters[] = { strPersonId,sDate };
    Serializable param[] = { strPersonId };
    System.out.println("The Controller Date passed is CBUtil "+sDate);
    System.out.println("The PersonId "+strPersonId);
    oaAM.invokeMethod("insertRow", parameters);
    oaAM.invokeMethod("initQuery", param);
    oaAM.invokeMethod("execQuery");
    String flag = "2";
    //pageContext.putSessionValue("strPersonId", strPersonId);
    pageContext.putSessionValue("PFlag1", flag);
    pageContext.putSessionValue("SDateSession1", sDate);
    pageContext.setForwardURL("OA.jsp?page=/EmployeeTest/oracle/apps/per/webui/EmpIBUtilPG",
    null,
    OAWebBeanConstants.KEEP_MENU_CONTEXT,
    null,
    null,
    true, // Retain AM
    OAWebBeanConstants.ADD_BREAD_CRUMB_YES, // Show breadcrumbs
    OAWebBeanConstants.IGNORE_MESSAGES);
    Hi Above two are the controller codes forget the rest of the codes,Concentrate on the PFR code, Just want to know what I am doing is correct or not.
    First time when I select the Picklist value,the value gets passed as a parameter to the custom package and the page gets displayed properly and vice versa,But I am not able to do the same cycle again for some reasons.
    Please get back to me ASAP.
    Regards,
    Magesh.M.K.
    Edited by: user1393742 on Oct 19, 2010 11:58 PM

  • Maps is not working properly anymore

    I am using iPad2 with iOS6 and since a few days Maps is not working properly anymore

    I'm having the same problem. I have a 4th gen 32GB iPod Touch, and since upgrading to iOS6, iMessage has been nothing but buggy. It will work for an hour or so, and then randomly stop working as it won't send or receive messages. There's nothing wrong with my wifi, because that's the same as it was before. I really hope someone knows something to fox this problem. Some people use iMessage for good reasons - it needs to be a reliable messaging service like it was in iOS5.

  • Sum function not working properly in Crystal XI. Its showing total count of the values

    We have migrated one application from .net framework 1.0 to .net framework  2 (from Visual studio 2003 to Visual STUDIO 2005). Now after migration we are facing some problem related to the sum function in Crystal report 10. It is not working properly.
    So we migrated to Crystal report XI release 2 (though still using evaluation version for testing purpose), the problem is not yet resolved.
    The problem we are facing is while using the summary in the group field, it is showing the number of rows instead of the sum of the values.
    We have checked the same with min-max functions, and it is working properly with those.
    We have tried to make the sum by formula field. In such case, it is not showing any syntactical error but at execution time, it is throwing an error saying "A number field or currency amount field is required here".
    In the  the report the datatype of the field on which we are applying the sum function, is number, and in the table from where the data is fetched, the datatype is numeric(9,6).
    Any idea why sum function is not working ?
    I was browsing the net and saw running totals can be a work around for such summation issues in Crystal Report XI.
    Can you please provide insight of how to implement running totals for summation purpose in solving such issues.

    Are you seeing this happen in the Crystal designer as well, outside of any .NET application?

  • IPAD 2 ,MY  iPAD IS UPDATED, BUT MAP SOFTWARE IS NOT WORKING PROPERLY ,LOCATION/ROUTE

    iPAD 2 ,MY  iPAD IS UPDATED, BUT MAP SOFTWARE IS NOT WORKING PROPERLY ,LOCATION/ROUTE & DISTANCE ALSO...
    CAN YOU GUIDE HOW TO SOLVE THIS PROBLEM....WAITING FOR SAME.
    VIRAL THAKKER- INDIA.
    ALSO, I HVE SOME PROBLEM IN MACBOOK SOFTWARE OPREATRING SYSTEM IS 10.6.1 AND TRY DOWNLOAD 10.6.8...BUT DON'T KNOW AFTER DOWNLOADING,I M NOT ABEL TO RUN IN MY MACHINE .
    ANY BODY CAN GUIDE ME? TO SOLVE THIS PROBL.
    VIRAL THAKKER INDIA

    Try this: Open up her Home folder (house icon), click Library then Preferences. Locate com.apple.softwareupdate.plst (I don't have my Mac handy so I can't double-check the name; that should be correct) and move it to the desktop or trash, then try running Software Update again. Also try running Software Update while logged in as another administrator.
    ~Lyssa

  • Substitution not working properly

    Hi,
    I have extended a VO and substituted.
    I could able to successfully add a new column in the LOV region from the VO.
    But when I tried to map the newly added column in the LOV region with the parent region item, its not working properly. There is no error but the dependent LOV does not take the value from the parent region.
    Anyone experienced similar problem?
    Regards,
    AD

    Hi Ram
    Thanks for the reply.
    No it does not take from any other LOV and there is no existing LOV mapping for this item.
    Its in the iExpense>Create expense report>General Information screen> Approver LOV
    The APPROVER LOV needs to be mapped with the field "Cost Center" which is not there in the standard functionality.
    Regards,
    AD

  • Subvi does not work properly when called inside a vi

    Hello Every body
    thanks for your help. i am using a sub vi for sine signal generation. as a vi it works fine. but when i called this subvi inside another VI it gives some problems. for example timer indicator works properly.it reinitializes as well in the sub vi, but in the main VI it does not work properly. means does not count the time.in the sub vi on the fly i can change the values of frequency and amplitude in real time, but when i use as sub vi, it does not reponse as i change the values in the control arrays.similarly pause and continue works properly in the sub vi, but once again in the main VI, it does not work properly.graph indicator also work properly in the sub vi. but here once again it does not work properly in the main VI.the pause resume indicator also does not blink, when it is continue. in the subvi it blinks very well.generally why the sub vi does not work properly inside the VI?i am sending my VI and sub vis.
    any tips would be highly appreciated.
    thanks
    Regards
    Attachments:
    vi.zip ‏87 KB

    I just want to add some more details to Dan's answer. The subVI is acting exactly like you've coded it. The mistake is in understanding how subVIs work. When you call a subVI (or a function in any other language), you pass some parameters to it, the subVI does it's thing and returns values. the subVI does not accept new parameters from the calling VI until it returns to the caller and the caller runs the subVI again. In your case, you have a subVI with a while loop. You have some front panel control wired to the subVI's stop terminal. When first called, the value is false. So the subVI will keep running until the subVI's stop button becomes true but you cannot change it from main until the subVI finishes and returns so the subVI will never stop. As Dan says, the solution is pass references of front panel controls to the subVI and have the subVI monitor those references for changes and to update references to indicators on Main. You subVI does not need any front panel controls or indicators of it's own.

  • Hi ALL i have a BDC code  it is not working properly

    this BDC code is not working properly , when ever the file is transfering BDC is aborting in the case of   invalid material/batch comes into teh picture... so please could you ''Check for invalid material/batch combinations so they are not processed by the BDC in the program and correctly output in an exception report''
    *****************************CODE HERE*****************************
    S E L E C T I O N S C R E E N
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.
    PARAMETERS: p_file LIKE rlgrap-filename,
    p_arch LIKE rlgrap-filename. "RM080107
    SELECTION-SCREEN SKIP.
    PARAMETERS: p_mode LIKE ctu_params-dismode DEFAULT 'N'.
    SELECTION-SCREEN END OF BLOCK b1.
    I N C L U D E S
    INCLUDE zwm_np_stock_recon_top.
    INCLUDE zwm_np_stock_recon_f01.
    I N I T I A L I Z A T I O N
    INITIALIZATION.
    PERFORM get_interface_filename USING c_interface_file p_file.
    PERFORM get_interface_filename USING c_archive_file p_arch."RM080107
    S T A R T O F S E L E C T I O N
    START-OF-SELECTION.
    PERFORM read_file USING p_file.
    PERFORM pre_processing.
    E N D O F S E L E C T I O N
    END-OF-SELECTION.
    PERFORM process_checks.
    IF w_no_change = 'X'.
    WRITE: / text-b03.
    WRITE: / sy-uline(34).
    ELSE.
    PERFORM bdc_mi09.
    PERFORM file_check_report.
    PERFORM bdc_report.
    ENDIF.
    PERFORM post_process_checks.
    *-- Move the processed file to archive directory
    PERFORM move_file.
    ...*************.........first include...................************
    INCLUDE ZWM_NP_STOCK_RECON_TOP *
    Data declaration ----------------------------------------------
    TYPES: st_rawdata(2000) TYPE c.
    TYPES: BEGIN OF st_stck_cnt,
    werks TYPE iseg-werks, "plant
    lgort TYPE iseg-lgort, "storage location
    matnr TYPE iseg-matnr, "material number
    charg TYPE iseg-charg, "batch
    vfdat TYPE mch1-vfdat, "Sell by date
    lwedt TYPE mch1-lwedt, "Manufacture date
    quarn(8) TYPE n, "qaunrantine quantity
    menge(8) TYPE n, "quantity on hand
    message(1), "Message Type (E/W/I)
    msg_txt TYPE t100-text, "Message Text
    zerostck(1), "Zero stock identifier "RM220307
    END OF st_stck_cnt.
    TYPES: BEGIN OF st_batch_errors,
    matnr TYPE iseg-matnr, "material number
    charg TYPE iseg-charg, "batch
    clabs TYPE mchb-clabs, "Stock Balance
    END OF st_batch_errors.
    DATA:
    t_rawdata TYPE TABLE OF st_rawdata,
    w_rawdata TYPE st_rawdata,
    t_stck_cnt TYPE TABLE OF st_stck_cnt,
    d_stck_cnt TYPE TABLE OF st_stck_cnt, "RM191006
    w_stck_cnt TYPE st_stck_cnt,
    t_batch_errors TYPE TABLE OF st_batch_errors,
    w_batch_errors TYPE st_batch_errors,
    t_messtab LIKE bdcmsgcoll OCCURS 0,
    w_messtab LIKE LINE OF t_messtab,
    w_no_change.
    CONSTANTS: c_interface_file(26) TYPE c VALUE 'ZNP_STOCK_RECON',
    c_archive_file(26) TYPE c
    VALUE 'ZNP_STOCK_RECON_ARCHIVE'. "RM080107
    .*************................second include..........************
    ***INCLUDE ZWM_NEXTPHARMA_STOKRECON_F01 .
    *& Form read_file
    reads NextPharma file sent through via webmethods
    -->P_FILENAME
    FORM read_file USING p_filename.
    CLEAR: t_rawdata,
    w_rawdata.
    REFRESH: t_rawdata.
    OPEN DATASET p_filename FOR INPUT IN TEXT MODE.
    IF sy-subrc <> 0.
    MESSAGE e720(01).
    ENDIF.
    DO.
    READ DATASET p_filename INTO w_rawdata.
    IF sy-subrc <> 0.
    EXIT.
    ELSE.
    APPEND w_rawdata TO t_rawdata.
    ENDIF.
    ENDDO.
    CLOSE DATASET p_filename.
    ENDFORM. " read_file
    *& Form pre_processing
    Read file values into internal table
    FORM pre_processing.
    DATA: lw_matnr TYPE iseg-matnr.
    LOOP AT t_rawdata INTO w_rawdata.
    lw_matnr = w_rawdata+21(20). "RM031006
    lw_matnr = w_rawdata+22(18). "RM031006
    CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'
    EXPORTING
    input = lw_matnr
    IMPORTING
    output = lw_matnr
    EXCEPTIONS
    length_error = 1
    OTHERS = 2.
    MOVE: lw_matnr TO w_stck_cnt-matnr.
    w_stck_cnt-werks = w_rawdata+14(4).
    w_stck_cnt-lgort = w_rawdata+18(4).
    w_stck_cnt-charg = w_rawdata+84(25).
    w_stck_cnt-vfdat = w_rawdata+109(8).
    w_stck_cnt-lwedt = w_rawdata+117(8).
    w_stck_cnt-quarn = w_rawdata+141(8).
    w_stck_cnt-menge = w_rawdata+125(8).
    APPEND w_stck_cnt TO t_stck_cnt.
    CLEAR w_stck_cnt.
    ENDLOOP.
    SORT t_stck_cnt BY werks
    lgort
    matnr
    charg.
    DELETE ADJACENT DUPLICATES FROM t_stck_cnt.
    ENDFORM. " pre_processing
    *& Form bdc_mi09
    Run file data via BDC TCODE: MI09
    FORM bdc_mi09.
    DATA: t_bdcdata TYPE TABLE OF bdcdata,
    w_bdcdata TYPE bdcdata,
    lw_datum(10) TYPE c,
    lw_count(2) TYPE n.
    WRITE sy-datum TO lw_datum DD/MM/YYYY.
    Front Screen
    CLEAR w_bdcdata.
    w_bdcdata-program = 'SAPMM07I'.
    w_bdcdata-dynpro = '0700'.
    w_bdcdata-dynbegin = 'X'.
    APPEND w_bdcdata TO t_bdcdata.
    Enter
    CLEAR w_bdcdata.
    w_bdcdata-fnam = 'BDC_OKCODE'.
    w_bdcdata-fval = '/00'.
    APPEND w_bdcdata TO t_bdcdata.
    Count Date
    CLEAR w_bdcdata.
    w_bdcdata-fnam = 'RM07I-ZLDAT'.
    w_bdcdata-fval = lw_datum.
    APPEND w_bdcdata TO t_bdcdata.
    Document Date
    CLEAR w_bdcdata.
    w_bdcdata-fnam = 'RM07I-BLDAT'.
    w_bdcdata-fval = lw_datum.
    APPEND w_bdcdata TO t_bdcdata.
    Plant
    CLEAR w_bdcdata.
    w_bdcdata-fnam = 'IKPF-WERKS'.
    w_bdcdata-fval = w_stck_cnt-werks.
    APPEND w_bdcdata TO t_bdcdata.
    Storage Location
    CLEAR w_bdcdata.
    w_bdcdata-fnam = 'IKPF-LGORT'.
    w_bdcdata-fval = w_stck_cnt-lgort.
    APPEND w_bdcdata TO t_bdcdata.
    LOOP AT t_stck_cnt INTO w_stck_cnt.
    Do not submit items with Errors against them
    CHECK w_stck_cnt-message NE 'E' AND
    w_stck_cnt-zerostck NE 'X'.
    "RM220307
    lw_count = lw_count + 1.
    Input Screen
    CLEAR w_bdcdata.
    w_bdcdata-program = 'SAPMM07I'.
    w_bdcdata-dynpro = '0731'.
    w_bdcdata-dynbegin = 'X'.
    APPEND w_bdcdata TO t_bdcdata.
    Page Down
    CLEAR w_bdcdata.
    w_bdcdata-fnam = 'BDC_OKCODE'.
    w_bdcdata-fval = '=P+'.
    APPEND w_bdcdata TO t_bdcdata.
    Material
    CLEAR w_bdcdata.
    w_bdcdata-fnam = 'ISEG-MATNR(01)'.
    w_bdcdata-fval = w_stck_cnt-matnr.
    APPEND w_bdcdata TO t_bdcdata.
    Batch
    CLEAR w_bdcdata.
    w_bdcdata-fnam = 'ISEG-CHARG(01)'.
    w_bdcdata-fval = w_stck_cnt-charg.
    APPEND w_bdcdata TO t_bdcdata.
    IF w_stck_cnt-menge NE 0.
    Quantity
    CLEAR w_bdcdata.
    w_bdcdata-fnam = 'ISEG-ERFMG(01)'.
    w_bdcdata-fval = w_stck_cnt-menge.
    APPEND w_bdcdata TO t_bdcdata.
    *-- Begin RM220307 - We need to create an item when the quantity is zero
    *-- in file and is non-zero in SAP
    ELSE.
    Zero Stock indicator
    CLEAR w_bdcdata.
    w_bdcdata-fnam = 'ISEG-XNULL(01)'.
    w_bdcdata-fval = 'X'.
    APPEND w_bdcdata TO t_bdcdata.
    *-- End RM220307
    ENDIF.
    ENDLOOP.
    CHECK lw_count NE 0.
    After all line items have been input
    Final Screen
    CLEAR w_bdcdata.
    w_bdcdata-program = 'SAPMM07I'.
    w_bdcdata-dynpro = '0731'.
    w_bdcdata-dynbegin = 'X'.
    APPEND w_bdcdata TO t_bdcdata.
    Save Document
    CLEAR w_bdcdata.
    w_bdcdata-fnam = 'BDC_OKCODE'.
    w_bdcdata-fval = '=BU'.
    APPEND w_bdcdata TO t_bdcdata.
    CALL TRANSACTION 'MI09' USING t_bdcdata
    MODE p_mode
    MESSAGES INTO t_messtab.
    ENDFORM. " bdc_mi09
    *& Form bdc_report
    Write BDC Messages.
    FORM bdc_report.
    DATA: lw_text TYPE t100-text.
    SKIP.
    WRITE: / text-b01.
    WRITE: / sy-uline(21).
    SKIP.
    Write BDC Messages
    LOOP AT t_messtab INTO w_messtab WHERE msgspra = sy-langu.
    MESSAGE ID w_messtab-msgid TYPE w_messtab-msgtyp
    NUMBER w_messtab-msgnr
    WITH w_messtab-msgv1
    w_messtab-msgv2
    w_messtab-msgv3
    w_messtab-msgv4
    INTO lw_text.
    WRITE: / lw_text.
    ENDLOOP.
    ENDFORM. " bdc_report
    *& Form process_checks
    Perform process check before creating BDC Session
    FORM process_checks.
    DATA: lw_clabs LIKE mchb-clabs,
    lw_menge LIKE mchb-clabs,
    lw_matnr LIKE mara-matnr,
    lw_charg LIKE mch1-charg,
    lw_fail,
    lw_vfdat TYPE mch1-vfdat,
    lv_sell TYPE c, "RM191006
    lv_qty(8) TYPE c. "RM191006
    CLEAR: d_stck_cnt[], d_stck_cnt. "RM191006
    Check if any of the stock figures differ from current stock figures
    LOOP AT t_stck_cnt INTO w_stck_cnt.
    lw_menge = w_stck_cnt-menge.
    SELECT SINGLE clabs INTO lw_clabs
    FROM mchb
    WHERE matnr = w_stck_cnt-matnr
    AND werks = w_stck_cnt-werks
    AND lgort = w_stck_cnt-lgort
    AND charg = w_stck_cnt-charg.
    IF sy-subrc = 0.
    IF lw_clabs NE lw_menge.
    lw_fail = 'X'.
    *-- Begin RM220307 - Do not create PI item if the stock is zero in the
    *-- file and is zero in SAP
    EXIT.
    ELSEIF lw_clabs = 0 AND lw_menge = 0.
    w_stck_cnt-zerostck = 'X'.
    MODIFY t_stck_cnt FROM w_stck_cnt.
    ENDIF.
    *-- End RM220307
    ELSE.
    lw_fail = 'X'.
    ERROR
    ENDIF.
    ENDLOOP.
    If no differences are found set NO CHANGE Flag
    IF lw_fail NE 'X'.
    w_no_change = 'X'.
    EXIT.
    ENDIF.
    Check for Errors in file data
    LOOP AT t_stck_cnt INTO w_stck_cnt.
    CLEAR lv_sell. "RM191006
    SELECT SINGLE matnr INTO lw_matnr
    FROM mara
    WHERE matnr = w_stck_cnt-matnr.
    IF sy-subrc NE 0.
    Invalid Material (E)
    w_stck_cnt-message = 'E'.
    w_stck_cnt-msg_txt = 'Invalid Material'.
    MODIFY t_stck_cnt FROM w_stck_cnt.
    CONTINUE.
    ENDIF.
    SELECT SINGLE charg vfdat
    INTO (lw_charg, lw_vfdat)
    FROM mch1 "KOB01 - changed from MCHA
    WHERE matnr = w_stck_cnt-matnr
    AND charg = w_stck_cnt-charg.
    AND werks = w_stck_cnt-werks.
    IF sy-subrc NE 0.
    Invalid Material Batch (E)
    w_stck_cnt-message = 'E'.
    CONCATENATE 'Invalid Material Batch for plant' w_stck_cnt-werks
    INTO w_stck_cnt-msg_txt SEPARATED BY space.
    MODIFY t_stck_cnt FROM w_stck_cnt.
    CONTINUE.
    ELSE.
    IF w_stck_cnt-vfdat <> lw_vfdat.
    Sell by dates do not match (W)
    w_stck_cnt-message = 'W'.
    w_stck_cnt-msg_txt =
    'Sell by Date does not match Shelf life Expiry Date'.
    MODIFY t_stck_cnt FROM w_stck_cnt.
    lv_sell = 'X'. "RM191006
    CONTINUE. "RM191006
    ENDIF.
    ENDIF.
    IF w_stck_cnt-quarn > 0.
    Quarantine balance not Zero (W)
    w_stck_cnt-message = 'W'.
    *-- Begin RM191006
    *-- We do want all warning messages on the report
    lv_qty = w_stck_cnt-quarn.
    CONDENSE lv_qty NO-GAPS.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
    EXPORTING
    input = lv_qty
    IMPORTING
    output = lv_qty.
    w_stck_cnt-msg_txt = 'Quarantine balance is not zero'.
    CONCATENATE 'Quarantine balance is ' lv_qty '- not zero'
    INTO w_stck_cnt-msg_txt SEPARATED BY space.
    MODIFY t_stck_cnt FROM w_stck_cnt.
    CONTINUE.
    IF lv_sell = 'X'.
    APPEND w_stck_cnt TO d_stck_cnt.
    CLEAR lv_sell.
    ELSE.
    MODIFY t_stck_cnt FROM w_stck_cnt.
    ENDIF.
    *-- End RM191006
    ENDIF.
    ENDLOOP.
    *-- Begin RM191006
    *-- Finally get all the records into dummy table to report
    APPEND LINES OF t_stck_cnt TO d_stck_cnt.
    SORT d_stck_cnt.
    DELETE ADJACENT DUPLICATES FROM d_stck_cnt.
    *-- End RM191006
    ENDFORM. " process_checks
    *& Form file_check_report
    Write warning and Error messages from File checks
    FORM file_check_report.
    WRITE: /2 'Material',
    22 'Batch',
    32 'Sell By',
    45 'Message Text'.
    WRITE: /2 sy-uline(115).
    SKIP.
    LOOP AT t_stck_cnt INTO w_stck_cnt. "RM191006
    LOOP AT d_stck_cnt INTO w_stck_cnt. "RM191006
    CHECK w_stck_cnt-message NE ' '.
    WRITE: /2 w_stck_cnt-matnr,
    22 w_stck_cnt-charg,
    32 w_stck_cnt-vfdat,
    43 w_stck_cnt-message,
    45 w_stck_cnt-msg_txt.
    ENDLOOP.
    ENDFORM. " file_check_report
    *& Form post_process_checks
    Check Material Batches in SAP against NP File
    FORM post_process_checks.
    RANGES: r_matnr FOR mchb-matnr,
    r_lgort FOR mchb-lgort,
    r_werks FOR mchb-werks.
    SORT t_stck_cnt.
    LOOP AT t_stck_cnt INTO w_stck_cnt.
    AT END OF matnr.
    r_lgort-sign = 'I'.
    r_lgort-option = 'EQ'.
    r_lgort-low = w_stck_cnt-lgort.
    APPEND r_lgort.
    r_werks-sign = 'I'.
    r_werks-option = 'EQ'.
    r_werks-low = w_stck_cnt-werks.
    APPEND r_werks.
    r_matnr-sign = 'I'.
    r_matnr-option = 'EQ'.
    r_matnr-low = w_stck_cnt-matnr.
    APPEND r_matnr.
    ENDAT.
    ENDLOOP.
    Select all material batches for NP Materials
    SELECT matnr charg clabs
    INTO TABLE t_batch_errors
    FROM mchb
    WHERE werks IN r_werks
    AND lgort IN r_lgort.
    IF sy-subrc EQ 0.
    Check if the Material Batches are in the NP file
    LOOP AT t_batch_errors INTO w_batch_errors.
    Disregard Batches without positive unrestricted stock
    IF w_batch_errors-clabs LE 0.
    DELETE t_batch_errors.
    CONTINUE.
    ENDIF.
    READ TABLE t_stck_cnt INTO w_stck_cnt
    WITH KEY matnr = w_batch_errors-matnr
    charg = w_batch_errors-charg.
    IF sy-subrc = 0.
    DELETE t_batch_errors.
    ENDIF.
    ENDLOOP.
    ENDIF.
    CHECK NOT t_batch_errors[] IS INITIAL.
    Write Batch chak results to report
    SKIP.
    WRITE: / text-b02.
    WRITE: / sy-uline(74).
    WRITE: /2 'Material',
    22 'Batch'.
    WRITE: /2 sy-uline(32).
    SKIP.
    LOOP AT t_batch_errors INTO w_batch_errors.
    WRITE: /2 w_batch_errors-matnr,
    22 w_batch_errors-charg.
    ENDLOOP.
    ENDFORM. " post_process_checks
    G E T _ I N T E R F A C E _ F I L E N A M E
    FORM get_interface_filename USING filename lw_path.
    DATA: i_file TYPE filename-fileintern,
    out_filename LIKE v_path-pathextern.
    CLEAR: out_filename.
    i_file = filename.
    get the interface filename to be used when creating file
    CALL FUNCTION 'FILE_GET_NAME'
    EXPORTING
    logical_filename = i_file
    IMPORTING
    file_name = out_filename
    EXCEPTIONS
    file_not_found = 1
    OTHERS = 2.
    IF sy-subrc = 0.
    MOVE out_filename TO lw_path.
    IF filename NE c_archive_file. "RM080107
    CONCATENATE lw_path 'NP_StockBalance.dat'
    INTO lw_path.
    *-- Begin RM080107 - Add timestamp to the archived file
    ELSE.
    CONCATENATE lw_path 'NP_StockBalance' sy-datum sy-uzeit '.dat'
    INTO lw_path.
    ENDIF.
    *-- End RM080107
    ELSE.
    ENDIF.
    ENDFORM. "get_interface_filename
    *& Form move_file RM080107
    Move the processed file to archive directory
    FORM move_file.
    *-- At last move the file to archive directory
    OPEN DATASET p_arch FOR OUTPUT IN TEXT MODE.
    IF sy-subrc = 0.
    LOOP AT t_rawdata INTO w_rawdata.
    TRANSFER w_rawdata TO p_arch.
    ENDLOOP.
    ENDIF.
    CLOSE DATASET p_arch.
    DELETE DATASET p_file.
    ENDFORM. " move_file

    Hi,
    S E L E C T I O N S C R E E N
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.
    PARAMETERS: p_file LIKE rlgrap-filename,
    p_arch LIKE rlgrap-filename. "RM080107
    SELECTION-SCREEN SKIP.
    PARAMETERS: p_mode LIKE ctu_params-dismode DEFAULT 'N'.
    SELECTION-SCREEN END OF BLOCK b1.
    I N C L U D E S
    INCLUDE zwm_np_stock_recon_top.
    INCLUDE zwm_np_stock_recon_f01.
    I N I T I A L I Z A T I O N
    INITIALIZATION.
    PERFORM get_interface_filename USING c_interface_file p_file.
    PERFORM get_interface_filename USING c_archive_file p_arch."RM080107
    S T A R T O F S E L E C T I O N
    START-OF-SELECTION.
    PERFORM read_file USING p_file.
    PERFORM pre_processing.
    E N D O F S E L E C T I O N
    END-OF-SELECTION.
    PERFORM process_checks.
    IF w_no_change = 'X'.
    WRITE: / text-b03.
    WRITE: / sy-uline(34).
    ELSE.
    PERFORM bdc_mi09.
    PERFORM file_check_report.
    PERFORM bdc_report.
    ENDIF.
    PERFORM post_process_checks.
    *-- Move the processed file to archive directory
    PERFORM move_file.
    ...*************.........first include...................************
    INCLUDE ZWM_NP_STOCK_RECON_TOP *
    Data declaration ----------------------------------------------
    TYPES: st_rawdata(2000) TYPE c.
    TYPES: BEGIN OF st_stck_cnt,
    werks TYPE iseg-werks, "plant
    lgort TYPE iseg-lgort, "storage location
    matnr TYPE iseg-matnr, "material number
    charg TYPE iseg-charg, "batch
    vfdat TYPE mch1-vfdat, "Sell by date
    lwedt TYPE mch1-lwedt, "Manufacture date
    quarn(8) TYPE n, "qaunrantine quantity
    menge(8) TYPE n, "quantity on hand
    message(1), "Message Type (E/W/I)
    msg_txt TYPE t100-text, "Message Text
    zerostck(1), "Zero stock identifier "RM220307
    END OF st_stck_cnt.
    TYPES: BEGIN OF st_batch_errors,
    matnr TYPE iseg-matnr, "material number
    charg TYPE iseg-charg, "batch
    clabs TYPE mchb-clabs, "Stock Balance
    END OF st_batch_errors.
    DATA:
    t_rawdata TYPE TABLE OF st_rawdata,
    w_rawdata TYPE st_rawdata,
    t_stck_cnt TYPE TABLE OF st_stck_cnt,
    d_stck_cnt TYPE TABLE OF st_stck_cnt, "RM191006
    w_stck_cnt TYPE st_stck_cnt,
    t_batch_errors TYPE TABLE OF st_batch_errors,
    w_batch_errors TYPE st_batch_errors,
    t_messtab LIKE bdcmsgcoll OCCURS 0,
    w_messtab LIKE LINE OF t_messtab,
    w_no_change.
    CONSTANTS: c_interface_file(26) TYPE c VALUE 'ZNP_STOCK_RECON',
    c_archive_file(26) TYPE c
    VALUE 'ZNP_STOCK_RECON_ARCHIVE'. "RM080107
    .*************................second include..........************
    ***INCLUDE ZWM_NEXTPHARMA_STOKRECON_F01 .
    *& Form read_file
    reads NextPharma file sent through via webmethods
    -->P_FILENAME
    FORM read_file USING p_filename.
    CLEAR: t_rawdata,
    w_rawdata.
    REFRESH: t_rawdata.
    OPEN DATASET p_filename FOR INPUT IN TEXT MODE.
    IF sy-subrc <> 0.
    MESSAGE e720(01).
    ENDIF.
    DO.
    READ DATASET p_filename INTO w_rawdata.
    IF sy-subrc <> 0.
    EXIT.
    ELSE.
    APPEND w_rawdata TO t_rawdata.
    ENDIF.
    ENDDO.
    CLOSE DATASET p_filename.
    ENDFORM. " read_file
    *& Form pre_processing
    Read file values into internal table
    FORM pre_processing.
    DATA: lw_matnr TYPE iseg-matnr.
    LOOP AT t_rawdata INTO w_rawdata.
    lw_matnr = w_rawdata+21(20). "RM031006
    lw_matnr = w_rawdata+22(18). "RM031006
    CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'
    EXPORTING
    input = lw_matnr
    IMPORTING
    output = lw_matnr
    EXCEPTIONS
    length_error = 1
    OTHERS = 2.
    MOVE: lw_matnr TO w_stck_cnt-matnr.
    w_stck_cnt-werks = w_rawdata+14(4).
    w_stck_cnt-lgort = w_rawdata+18(4).
    w_stck_cnt-charg = w_rawdata+84(25).
    w_stck_cnt-vfdat = w_rawdata+109(8).
    w_stck_cnt-lwedt = w_rawdata+117(8).
    w_stck_cnt-quarn = w_rawdata+141(8).
    w_stck_cnt-menge = w_rawdata+125(8).
    APPEND w_stck_cnt TO t_stck_cnt.
    CLEAR w_stck_cnt.
    ENDLOOP.
    SORT t_stck_cnt BY werks
    lgort
    matnr
    charg.
    DELETE ADJACENT DUPLICATES FROM t_stck_cnt.
    ENDFORM. " pre_processing
    *& Form bdc_mi09
    Run file data via BDC TCODE: MI09
    FORM bdc_mi09.
    DATA: t_bdcdata TYPE TABLE OF bdcdata,
    w_bdcdata TYPE bdcdata,
    lw_datum(10) TYPE c,
    lw_count(2) TYPE n.
    WRITE sy-datum TO lw_datum DD/MM/YYYY.
    <b>select single MATNR
                       WERKS
                       CHARG
               from MCHA
               into (l_matnr, l_werks, l_charg)
               where matnr = w_stck_cnt-matnr
                  and werks = w_stck_cnt-werks.
                  and charg =  w_stck_cnt-charg.
    if sy-subrc ne 0.
    continue.
    endif.</b>
    Front Screen
    CLEAR w_bdcdata.
    w_bdcdata-program = 'SAPMM07I'.
    w_bdcdata-dynpro = '0700'.
    w_bdcdata-dynbegin = 'X'.
    APPEND w_bdcdata TO t_bdcdata.
    Enter
    CLEAR w_bdcdata.
    w_bdcdata-fnam = 'BDC_OKCODE'.
    w_bdcdata-fval = '/00'.
    APPEND w_bdcdata TO t_bdcdata.
    Count Date
    CLEAR w_bdcdata.
    w_bdcdata-fnam = 'RM07I-ZLDAT'.
    w_bdcdata-fval = lw_datum.
    APPEND w_bdcdata TO t_bdcdata.
    Document Date
    CLEAR w_bdcdata.
    w_bdcdata-fnam = 'RM07I-BLDAT'.
    w_bdcdata-fval = lw_datum.
    APPEND w_bdcdata TO t_bdcdata.
    Plant
    CLEAR w_bdcdata.
    w_bdcdata-fnam = 'IKPF-WERKS'.
    w_bdcdata-fval = w_stck_cnt-werks.
    APPEND w_bdcdata TO t_bdcdata.
    Storage Location
    CLEAR w_bdcdata.
    w_bdcdata-fnam = 'IKPF-LGORT'.
    w_bdcdata-fval = w_stck_cnt-lgort.
    APPEND w_bdcdata TO t_bdcdata.
    LOOP AT t_stck_cnt INTO w_stck_cnt.
    Do not submit items with Errors against them
    CHECK w_stck_cnt-message NE 'E' AND
    w_stck_cnt-zerostck NE 'X'.
    "RM220307
    lw_count = lw_count + 1.
    Input Screen
    CLEAR w_bdcdata.
    w_bdcdata-program = 'SAPMM07I'.
    w_bdcdata-dynpro = '0731'.
    w_bdcdata-dynbegin = 'X'.
    APPEND w_bdcdata TO t_bdcdata.
    Page Down
    CLEAR w_bdcdata.
    w_bdcdata-fnam = 'BDC_OKCODE'.
    w_bdcdata-fval = '=P+'.
    APPEND w_bdcdata TO t_bdcdata.
    Material
    CLEAR w_bdcdata.
    w_bdcdata-fnam = 'ISEG-MATNR(01)'.
    w_bdcdata-fval = w_stck_cnt-matnr.
    APPEND w_bdcdata TO t_bdcdata.
    Batch
    CLEAR w_bdcdata.
    w_bdcdata-fnam = 'ISEG-CHARG(01)'.
    w_bdcdata-fval = w_stck_cnt-charg.
    APPEND w_bdcdata TO t_bdcdata.
    IF w_stck_cnt-menge NE 0.
    Quantity
    CLEAR w_bdcdata.
    w_bdcdata-fnam = 'ISEG-ERFMG(01)'.
    w_bdcdata-fval = w_stck_cnt-menge.
    APPEND w_bdcdata TO t_bdcdata.
    *-- Begin RM220307 - We need to create an item when the quantity is zero
    *-- in file and is non-zero in SAP
    ELSE.
    Zero Stock indicator
    CLEAR w_bdcdata.
    w_bdcdata-fnam = 'ISEG-XNULL(01)'.
    w_bdcdata-fval = 'X'.
    APPEND w_bdcdata TO t_bdcdata.
    *-- End RM220307
    ENDIF.
    ENDLOOP.
    CHECK lw_count NE 0.
    After all line items have been input
    Final Screen
    CLEAR w_bdcdata.
    w_bdcdata-program = 'SAPMM07I'.
    w_bdcdata-dynpro = '0731'.
    w_bdcdata-dynbegin = 'X'.
    APPEND w_bdcdata TO t_bdcdata.
    Save Document
    CLEAR w_bdcdata.
    w_bdcdata-fnam = 'BDC_OKCODE'.
    w_bdcdata-fval = '=BU'.
    APPEND w_bdcdata TO t_bdcdata.
    CALL TRANSACTION 'MI09' USING t_bdcdata
    MODE p_mode
    MESSAGES INTO t_messtab.
    ENDFORM. " bdc_mi09
    *& Form bdc_report
    Write BDC Messages.
    FORM bdc_report.
    DATA: lw_text TYPE t100-text.
    SKIP.
    WRITE: / text-b01.
    WRITE: / sy-uline(21).
    SKIP.
    Write BDC Messages
    LOOP AT t_messtab INTO w_messtab WHERE msgspra = sy-langu.
    MESSAGE ID w_messtab-msgid TYPE w_messtab-msgtyp
    NUMBER w_messtab-msgnr
    WITH w_messtab-msgv1
    w_messtab-msgv2
    w_messtab-msgv3
    w_messtab-msgv4
    INTO lw_text.
    WRITE: / lw_text.
    ENDLOOP.
    ENDFORM. " bdc_report
    *& Form process_checks
    Perform process check before creating BDC Session
    FORM process_checks.
    DATA: lw_clabs LIKE mchb-clabs,
    lw_menge LIKE mchb-clabs,
    lw_matnr LIKE mara-matnr,
    lw_charg LIKE mch1-charg,
    lw_fail,
    lw_vfdat TYPE mch1-vfdat,
    lv_sell TYPE c, "RM191006
    lv_qty(8) TYPE c. "RM191006
    CLEAR: d_stck_cnt[], d_stck_cnt. "RM191006
    Check if any of the stock figures differ from current stock figures
    LOOP AT t_stck_cnt INTO w_stck_cnt.
    lw_menge = w_stck_cnt-menge.
    SELECT SINGLE clabs INTO lw_clabs
    FROM mchb
    WHERE matnr = w_stck_cnt-matnr
    AND werks = w_stck_cnt-werks
    AND lgort = w_stck_cnt-lgort
    AND charg = w_stck_cnt-charg.
    IF sy-subrc = 0.
    IF lw_clabs NE lw_menge.
    lw_fail = 'X'.
    *-- Begin RM220307 - Do not create PI item if the stock is zero in the
    *-- file and is zero in SAP
    EXIT.
    ELSEIF lw_clabs = 0 AND lw_menge = 0.
    w_stck_cnt-zerostck = 'X'.
    MODIFY t_stck_cnt FROM w_stck_cnt.
    ENDIF.
    *-- End RM220307
    ELSE.
    lw_fail = 'X'.
    ERROR
    ENDIF.
    ENDLOOP.
    If no differences are found set NO CHANGE Flag
    IF lw_fail NE 'X'.
    w_no_change = 'X'.
    EXIT.
    ENDIF.
    Check for Errors in file data
    LOOP AT t_stck_cnt INTO w_stck_cnt.
    CLEAR lv_sell. "RM191006
    SELECT SINGLE matnr INTO lw_matnr
    FROM mara
    WHERE matnr = w_stck_cnt-matnr.
    IF sy-subrc NE 0.
    Invalid Material (E)
    w_stck_cnt-message = 'E'.
    w_stck_cnt-msg_txt = 'Invalid Material'.
    MODIFY t_stck_cnt FROM w_stck_cnt.
    CONTINUE.
    ENDIF.
    SELECT SINGLE charg vfdat
    INTO (lw_charg, lw_vfdat)
    FROM mch1 "KOB01 - changed from MCHA
    WHERE matnr = w_stck_cnt-matnr
    AND charg = w_stck_cnt-charg.
    AND werks = w_stck_cnt-werks.
    IF sy-subrc NE 0.
    Invalid Material Batch (E)
    w_stck_cnt-message = 'E'.
    CONCATENATE 'Invalid Material Batch for plant' w_stck_cnt-werks
    INTO w_stck_cnt-msg_txt SEPARATED BY space.
    MODIFY t_stck_cnt FROM w_stck_cnt.
    CONTINUE.
    ELSE.
    IF w_stck_cnt-vfdat <> lw_vfdat.
    Sell by dates do not match (W)
    w_stck_cnt-message = 'W'.
    w_stck_cnt-msg_txt =
    'Sell by Date does not match Shelf life Expiry Date'.
    MODIFY t_stck_cnt FROM w_stck_cnt.
    lv_sell = 'X'. "RM191006
    CONTINUE. "RM191006
    ENDIF.
    ENDIF.
    IF w_stck_cnt-quarn > 0.
    Quarantine balance not Zero (W)
    w_stck_cnt-message = 'W'.
    *-- Begin RM191006
    *-- We do want all warning messages on the report
    lv_qty = w_stck_cnt-quarn.
    CONDENSE lv_qty NO-GAPS.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
    EXPORTING
    input = lv_qty
    IMPORTING
    output = lv_qty.
    w_stck_cnt-msg_txt = 'Quarantine balance is not zero'.
    CONCATENATE 'Quarantine balance is ' lv_qty '- not zero'
    INTO w_stck_cnt-msg_txt SEPARATED BY space.
    MODIFY t_stck_cnt FROM w_stck_cnt.
    CONTINUE.
    IF lv_sell = 'X'.
    APPEND w_stck_cnt TO d_stck_cnt.
    CLEAR lv_sell.
    ELSE.
    MODIFY t_stck_cnt FROM w_stck_cnt.
    ENDIF.
    *-- End RM191006
    ENDIF.
    ENDLOOP.
    *-- Begin RM191006
    *-- Finally get all the records into dummy table to report
    APPEND LINES OF t_stck_cnt TO d_stck_cnt.
    SORT d_stck_cnt.
    DELETE ADJACENT DUPLICATES FROM d_stck_cnt.
    *-- End RM191006
    ENDFORM. " process_checks
    *& Form file_check_report
    Write warning and Error messages from File checks
    FORM file_check_report.
    WRITE: /2 'Material',
    22 'Batch',
    32 'Sell By',
    45 'Message Text'.
    WRITE: /2 sy-uline(115).
    SKIP.
    LOOP AT t_stck_cnt INTO w_stck_cnt. "RM191006
    LOOP AT d_stck_cnt INTO w_stck_cnt. "RM191006
    CHECK w_stck_cnt-message NE ' '.
    WRITE: /2 w_stck_cnt-matnr,
    22 w_stck_cnt-charg,
    32 w_stck_cnt-vfdat,
    43 w_stck_cnt-message,
    45 w_stck_cnt-msg_txt.
    ENDLOOP.
    ENDFORM. " file_check_report
    *& Form post_process_checks
    Check Material Batches in SAP against NP File
    FORM post_process_checks.
    RANGES: r_matnr FOR mchb-matnr,
    r_lgort FOR mchb-lgort,
    r_werks FOR mchb-werks.
    SORT t_stck_cnt.
    LOOP AT t_stck_cnt INTO w_stck_cnt.
    AT END OF matnr.
    r_lgort-sign = 'I'.
    r_lgort-option = 'EQ'.
    r_lgort-low = w_stck_cnt-lgort.
    APPEND r_lgort.
    r_werks-sign = 'I'.
    r_werks-option = 'EQ'.
    r_werks-low = w_stck_cnt-werks.
    APPEND r_werks.
    r_matnr-sign = 'I'.
    r_matnr-option = 'EQ'.
    r_matnr-low = w_stck_cnt-matnr.
    APPEND r_matnr.
    ENDAT.
    ENDLOOP.
    Select all material batches for NP Materials
    SELECT matnr charg clabs
    INTO TABLE t_batch_errors
    FROM mchb
    WHERE werks IN r_werks
    AND lgort IN r_lgort.
    IF sy-subrc EQ 0.
    Check if the Material Batches are in the NP file
    LOOP AT t_batch_errors INTO w_batch_errors.
    Disregard Batches without positive unrestricted stock
    IF w_batch_errors-clabs LE 0.
    DELETE t_batch_errors.
    CONTINUE.
    ENDIF.
    READ TABLE t_stck_cnt INTO w_stck_cnt
    WITH KEY matnr = w_batch_errors-matnr
    charg = w_batch_errors-charg.
    IF sy-subrc = 0.
    DELETE t_batch_errors.
    ENDIF.
    ENDLOOP.
    ENDIF.
    CHECK NOT t_batch_errors[] IS INITIAL.
    Write Batch chak results to report
    SKIP.
    WRITE: / text-b02.
    WRITE: / sy-uline(74).
    WRITE: /2 'Material',
    22 'Batch'.
    WRITE: /2 sy-uline(32).
    SKIP.
    LOOP AT t_batch_errors INTO w_batch_errors.
    WRITE: /2 w_batch_errors-matnr,
    22 w_batch_errors-charg.
    ENDLOOP.
    ENDFORM. " post_process_checks
    G E T _ I N T E R F A C E _ F I L E N A M E
    FORM get_interface_filename USING filename lw_path.
    DATA: i_file TYPE filename-fileintern,
    out_filename LIKE v_path-pathextern.
    CLEAR: out_filename.
    i_file = filename.
    get the interface filename to be used when creating file
    CALL FUNCTION 'FILE_GET_NAME'
    EXPORTING
    logical_filename = i_file
    IMPORTING
    file_name = out_filename
    EXCEPTIONS
    file_not_found = 1
    OTHERS = 2.
    IF sy-subrc = 0.
    MOVE out_filename TO lw_path.
    IF filename NE c_archive_file. "RM080107
    CONCATENATE lw_path 'NP_StockBalance.dat'
    INTO lw_path.
    *-- Begin RM080107 - Add timestamp to the archived file
    ELSE.
    CONCATENATE lw_path 'NP_StockBalance' sy-datum sy-uzeit '.dat'
    INTO lw_path.
    ENDIF.
    *-- End RM080107
    ELSE.
    ENDIF.
    ENDFORM. "get_interface_filename
    *& Form move_file RM080107
    Move the processed file to archive directory
    FORM move_file.
    *-- At last move the file to archive directory
    OPEN DATASET p_arch FOR OUTPUT IN TEXT MODE.
    IF sy-subrc = 0.
    LOOP AT t_rawdata INTO w_rawdata.
    TRANSFER w_rawdata TO p_arch.
    ENDLOOP.
    ENDIF.
    CLOSE DATASET p_arch.
    DELETE DATASET p_file.
    ENDFORM. " move_file
    Best regards,
    Prashant

  • Copy Function is Not Working properly In Order Management

    Hi,
    Description-
    When an order with remnant model is copied, it copied only the topple model line and they include items attached to the top model line. It doesn’t copy the
    option class lines and the option item lines (unshipped and shipped).
    Example-
    Enter an order with for pd-pto-model. See order#21231.The ordered quantities and structure of the model is shown below:
    pd-pto-model 5 qty
    pd-std-item1 (included item) 5 qty
    pd-pto-oc (option class) 5 qty
    pd-std-item1 (included item with rfr checked) 5 qty
    pd-std-item2 (option item with rfr checked) 5 qty
    pd-std-item3 (option item) 5 qty
    Booked the order and pick relased the order. While shipconfirming only shipped 5 qty of pd-std-item3 and staged the rest. On querying the sales order, the line status is seen correctly as follows:
    pd-pto-model Closed
    pd-std-item1 (included item) Picked
    pd-pto-oc (option class) Closed
    pd-std-item1 (included item with rfr checked) Picked
    pd-std-item2 (option item with rfr checked) Picked
    pd-std-item3 (option item) Partially Interfaced to receivables
    Copied this order from the order header. The new order# is 21232.On querying the order, I see only 2 lines as follows:pd-pto-model.
    Anyone can help me on this issue.
    Thanks,
    Chinna

    haisrig wrote:
    Hi ,
    We are facing an issue with select() in Solaris 10. we had written a sample program to this issue.
    Program name :- sel.cpp
    int main()
    struct timeval sleeptime;
    sleeptime.tv_sec = 60;
    printf("1\n");
    select(0,NULL,NULL,NULL,&sleeptime);
    printf("2");
    return 0;
    When i run this program in Solaris 9, its printing 1 and after one minute its printing 2.
    When i run this program on Solaris 10, its printing 1 and 2 without waiting for 60 seconds.
    When i tried to print tv_usec, its printing as 0 in solaris 9 and some garbage values in solaris 10.
    I think because of that the above select function is not working properly in solaris 10.
    Why the tv_usec is not taking 0 as default values in Solaris 10?
    We are using our legacy code for past 20 years. So, before going to do any changes we are trying to find why this happenig like this.Hi
    It sounds to me that you've been lucky for 20 years then.
    Local POD variables on the stack that aren't explicitly initialized can contain any value. Here's what I see in your app with dbx
    (dbx) run
    Running: sel
    stopped in main at line 9 in file "sel.cpp"
        9      sleeptime.tv_sec = 60;
    (dbx) print sleeptime
    sleeptime = {
        tv_sec  = -4198732
        tv_usec = 0
    }That's on a Solaris 10 SPARC machine. If I try it on a Solaris 10 x86 box then I get
    (dbx) print sleeptime
    sleeptime = {
    tv_sec = -830490588
    tv_usec = 134510556
    and I see the behaviour that you describe.
    Paul

  • Select() function is not working properly in solaris 10.

    Hi ,
    We are facing an issue with select() in Solaris 10. we had written a sample program to this issue.
    Program name :- sel.cpp
    int main()
    struct timeval sleeptime;
    sleeptime.tv_sec = 60;
    printf("1\n");
    select(0,NULL,NULL,NULL,&sleeptime);
    printf("2");
    return 0;
    When i run this program in Solaris 9, its printing 1 and after one minute its printing 2.
    When i run this program on Solaris 10, its printing 1 and 2 without waiting for 60 seconds.
    When i tried to print tv_usec, its printing as 0 in solaris 9 and some garbage values in solaris 10.
    I think because of that the above select function is not working properly in solaris 10.
    Why the tv_usec is not taking 0 as default values in Solaris 10?
    We are using our legacy code for past 20 years. So, before going to do any changes we are trying to find why this happenig like this.
    Thanks a lot.
    Regards,
    Srikanth.

    haisrig wrote:
    Hi ,
    We are facing an issue with select() in Solaris 10. we had written a sample program to this issue.
    Program name :- sel.cpp
    int main()
    struct timeval sleeptime;
    sleeptime.tv_sec = 60;
    printf("1\n");
    select(0,NULL,NULL,NULL,&sleeptime);
    printf("2");
    return 0;
    When i run this program in Solaris 9, its printing 1 and after one minute its printing 2.
    When i run this program on Solaris 10, its printing 1 and 2 without waiting for 60 seconds.
    When i tried to print tv_usec, its printing as 0 in solaris 9 and some garbage values in solaris 10.
    I think because of that the above select function is not working properly in solaris 10.
    Why the tv_usec is not taking 0 as default values in Solaris 10?
    We are using our legacy code for past 20 years. So, before going to do any changes we are trying to find why this happenig like this.Hi
    It sounds to me that you've been lucky for 20 years then.
    Local POD variables on the stack that aren't explicitly initialized can contain any value. Here's what I see in your app with dbx
    (dbx) run
    Running: sel
    stopped in main at line 9 in file "sel.cpp"
        9      sleeptime.tv_sec = 60;
    (dbx) print sleeptime
    sleeptime = {
        tv_sec  = -4198732
        tv_usec = 0
    }That's on a Solaris 10 SPARC machine. If I try it on a Solaris 10 x86 box then I get
    (dbx) print sleeptime
    sleeptime = {
    tv_sec = -830490588
    tv_usec = 134510556
    and I see the behaviour that you describe.
    Paul

Maybe you are looking for

  • Firefox 36.0.4 on dell venue 8 3830 does not work

    App opens but will not navigate to any website the progress bar quickly moves to about 25% and stays there. I tried uninstalling and reinstalling the app.

  • HT4356 Can you choose to print B&W vs Color over airprint?

    Does anyone have advice on how to print a color doc in B&W? We are printing from emails to a color laser but don't want to waste ink on the drafts of our documents. We receive a substantial amount of layout material and it is always in color. We don'

  • Number range Interval HU_VEKP

    Hi, I am a technical consultant and came across number range intervals for the first time. Need some help for you. I am trying to define packaging material types. One of the statements says that I to ensure that <b>the number assignment of your packi

  • Workflow Deadline monitoring

    Hi, Is it possible to re-trigger deadline monitoring more than once, so that if a PO approver has not released a PO within 24 hours, they will receive a reminder every 12 hours until this task

  • Security in BO

    Hello, Has anybody a manual of authorization and access level? I want to organize security for objects, but don't understand some features. If somedy can show how I can organize security in BO look like BW(users and roles) it'll be great. I transfere