Function Module to Fetch data of Vendor for Inbound Delivery at runtime

Hi All,
I am new to EWM. I am using BADI /SCWM/EX_DLV_DET_PROCTYPE method CHANGE_PROCTYPE to change process type of the inbound delivery as per some logic from a custom table. However the parameter Vendor is not available in IS_ITEM during inbound delivery creation. Vendor is one of the key fields in my table.
Does anyone know any solution/function modules to fetch vendor data for the inbound delivery at runtime. I know the database tables to fetch vendor but this works only once the inbound delivery is saved.
Thanks and Regards,
  Vanessa Noronha

Hi All,
I am new to EWM. I am using BADI /SCWM/EX_DLV_DET_PROCTYPE method CHANGE_PROCTYPE to change process type of the inbound delivery as per some logic from a custom table. However the parameter Vendor is not available in IS_ITEM during inbound delivery creation. Vendor is one of the key fields in my table.
Does anyone know any solution/function modules to fetch vendor data for the inbound delivery at runtime. I know the database tables to fetch vendor but this works only once the inbound delivery is saved.
Thanks and Regards,
  Vanessa Noronha

Similar Messages

  • Generic datasource by function module to fetch data from multiple tables?

    I'm writing a function module to fetch price, for generic datasource.
    At first, extract test is OK. But InfoPackage never stop  when loading data to PSA in BW.
    And I find the example codes:
         OPEN CURSOR WITH HOLD S_CURSOR FOR
          SELECT (S_S_IF-T_FIELDS) FROM SFLIGHT
                                   WHERE CARRID  IN L_R_CARRID AND
                                         CONNID  IN L_R_CONNID.
        ENDIF.                             "First data package ?
    * Fetch records into interface table.
    *   named E_T_'Name of extract structure'.
        FETCH NEXT CURSOR S_CURSOR
                   APPENDING CORRESPONDING FIELDS
                   OF TABLE E_T_DATA
                   PACKAGE SIZE S_S_IF-MAXSIZE.
        IF SY-SUBRC <> 0.
          CLOSE CURSOR S_CURSOR.
          RAISE NO_MORE_DATA.
        ENDIF.
        S_COUNTER_DATAPAKID = S_COUNTER_DATAPAKID + 1.
      ENDIF.
    There using Cursor to fetch data package by package, and raise exception NO_MORE_DATA to stop the loading process.
    Now I fetch data from multiple tables, I don't think I can use Cursor.
    Then How can I handle this?  
    Thanks a lot.

    Thanks
    IF IT_999[] IS INITIAL.
        SELECT A~KNUMH A~MATNR A~KSCHL VKORG VTWEG A~DATBI A~DATAB KBETR KMEIN KPEIN C~MTART APPENDING CORRESPONDING FIELDS OF
          TABLE TP_DATA
            FROM A999 AS A
              INNER JOIN KONP AS B
                  ON A~KNUMH = B~KNUMH
              INNER JOIN MARA AS C
                 ON A~MATNR = C~MATNR
    *          FOR ALL ENTRIES IN IT_999
                    WHERE
    *      A~KNUMH = IT_999-KNUMH  AND
           ( ( A~KSCHL = 'ZPRC' AND VKORG = 'Z000' AND VTWEG = 'Z1' ) OR
                          ( A~KSCHL = 'ZPRD' AND VKORG = 'A000' AND VTWEG = 'Y3' ) ) AND
    *                      A~DATBI >= SY-DATUM AND
                          LOEVM_KO = ''.
        SELECT A~KNUMH A~MATNR A~KSCHL VKORG VTWEG A~DATBI A~DATAB KBETR AS KHETR  KMEIN KPEIN C~MTART APPENDING CORRESPONDING FIELDS OF
          TABLE TP_DATA
            FROM A999 AS A
              INNER JOIN KONP AS B
                  ON A~KNUMH = B~KNUMH
              INNER JOIN MARA AS C
                 ON A~MATNR = C~MATNR
    *          FOR ALL ENTRIES IN IT_999
                    WHERE
    *      A~KNUMH = IT_999-KNUMH AND
          A~KSCHL = 'ZPR3' AND A~VKORG = 'I000' AND
    *                      DATBI >= SY-DATUM AND
                          LOEVM_KO = ''.
      ENDIF.
      IF IT_997[] IS INITIAL.
        SELECT A~KNUMH A~MATNR A~KSCHL VTWEG A~DATBI A~DATAB KBETR AS KHETR KMEIN KPEIN C~MTART APPENDING CORRESPONDING FIELDS OF
          TABLE TP_DATA
            FROM A997 AS A
              INNER JOIN KONP AS B
                  ON A~KNUMH = B~KNUMH
              INNER JOIN MARA AS C
                 ON A~MATNR = C~MATNR
    *          FOR ALL ENTRIES IN IT_997
                    WHERE
    *      A~KNUMH = IT_997-KNUMH      AND
          A~KSCHL = 'ZPRA' AND VTWEG = 'Y1' AND
    *                      DATBI >= SY-DATUM AND
                      LOEVM_KO = ''.
      ENDIF.
      IF IT_996[] IS INITIAL.
        SELECT A~KNUMH A~MATNR A~KSCHL A~DATBI A~DATAB KBETR AS KHETR KMEIN KPEIN C~MTART APPENDING CORRESPONDING FIELDS OF
           TABLE TP_DATA
             FROM A996 AS A
               INNER JOIN KONP AS B
                   ON A~KNUMH = B~KNUMH
               INNER JOIN MARA AS C
                  ON A~MATNR = C~MATNR
    *          FOR ALL ENTRIES IN IT_996
                    WHERE
    *      A~KNUMH = IT_996-KNUMH AND
          A~KSCHL = 'ZPRB' AND
    *                       DATBI >= SY-DATUM AND
          LOEVM_KO = ''.
      ENDIF.
      SELECT   MATNR     "u7269u6599u53F7u7801
               MEINH     "u4ED3u50A8u5355u4F4Du7684u5907u7528u8BA1u91CFu5355u4F4D
               UMREZ     "u57FAu672Cu8BA1u91CFu5355u4F4Du8F6Cu6362u5206u5B50
               UMREN     "u8F6Cu6362u4E3Au57FAu672Cu8BA1u91CFu5355u4F4Du7684u5206u6BCD
          FROM MARM
          INTO CORRESPONDING FIELDS OF TABLE IT_MARM
           FOR ALL ENTRIES IN TP_DATA
         WHERE MATNR = TP_DATA-MATNR AND  MEINH = TP_DATA-KMEIN.
      LOOP AT TP_DATA.
        IF TP_DATA-KPEIN NE 0.
          TP_DATA-KBETR =  TP_DATA-KBETR / TP_DATA-KPEIN.
          TP_DATA-KHETR =  TP_DATA-KHETR / TP_DATA-KPEIN.
        ENDIF.
        IF TP_DATA-KSCHL = 'ZPRA'.
    *       TP_DATA-MEINH = 'ZI'.
    *      TP_DATA-KSCHL = 'B4'.
          IF TP_DATA-KMEIN = 'ZI'.
            TP_DATA-KBETR = TP_DATA-KHETR / '1.17'.
          ELSE.
            READ TABLE IT_MARM INTO WA_MARM1 WITH KEY MATNR = TP_DATA-MATNR MEINH = TP_DATA-KMEIN.
    *           READ TABLE IT_MARM INTO WA_MARM2 WITH KEY MATNR = TP_DATA-MATNR MEINH = 'CT'.
            TP_DATA-KHETR = TP_DATA-KHETR * WA_MARM1-UMREN / WA_MARM1-UMREZ.
    *           * WA_MARM2-UMREZ / WA_MARM2-UMREN.
            TP_DATA-KBETR = TP_DATA-KHETR / '1.17'.
          ENDIF.
        ELSEIF TP_DATA-KSCHL = 'ZPRB'.
    *      TP_DATA-KSCHL = 'L0'.
    *       TP_DATA-MEINH = 'ZI'.
          IF TP_DATA-KMEIN = 'ZI'.
            TP_DATA-KBETR = TP_DATA-KHETR / '1.17'.
          ELSE.
            READ TABLE IT_MARM INTO WA_MARM1 WITH KEY MATNR = TP_DATA-MATNR MEINH = TP_DATA-KMEIN.
    *           READ TABLE IT_MARM INTO WA_MARM2 WITH KEY MATNR = TP_DATA-MATNR MEINH = 'BAG'.
            TP_DATA-KHETR = TP_DATA-KHETR * WA_MARM1-UMREN / WA_MARM1-UMREZ.
    *           * WA_MARM2-UMREZ / WA_MARM2-UMREN.
            TP_DATA-KBETR = TP_DATA-KHETR / '1.17'.
          ENDIF.
        ELSEIF TP_DATA-KSCHL = 'ZPRC' OR TP_DATA-KSCHL = 'ZPRD'.
    *       TP_DATA-MEINH = 'ZI'.
          IF TP_DATA-KMEIN = 'ZI'.
            TP_DATA-KHETR = TP_DATA-KBETR * '1.17'.
          ELSE.
            READ TABLE IT_MARM INTO WA_MARM1 WITH KEY MATNR = TP_DATA-MATNR MEINH = TP_DATA-KMEIN.
    *           READ TABLE IT_MARM INTO WA_MARM2 WITH KEY MATNR = TP_DATA-MATNR MEINH = 'WZI'.
            TP_DATA-KBETR = TP_DATA-KBETR * WA_MARM1-UMREN / WA_MARM1-UMREZ.
    *           * WA_MARM2-UMREZ / WA_MARM2-UMREN.
            TP_DATA-KHETR = TP_DATA-KBETR * '1.17'.
          ENDIF.
        ELSEIF TP_DATA-KSCHL = 'ZPR3'.
    *      TP_DATA-KSCHL = 'B2'.
          IF TP_DATA-KMEIN = 'ZI'.
            TP_DATA-KBETR = TP_DATA-KHETR / '1.17'.
          ELSE.
            READ TABLE IT_MARM INTO WA_MARM1 WITH KEY MATNR = TP_DATA-MATNR MEINH = TP_DATA-KMEIN.
    *           READ TABLE IT_MARM INTO WA_MARM2 WITH KEY MATNR = TP_DATA-MATNR MEINH = 'BAG'.
            TP_DATA-KHETR = TP_DATA-KHETR * WA_MARM1-UMREN / WA_MARM1-UMREZ.
    *           * WA_MARM2-UMREZ / WA_MARM2-UMREN.
            TP_DATA-KBETR = TP_DATA-KHETR / '1.17'.
          ENDIF.
        ENDIF.
        TP_DATA-MEINH = '01'.
        MODIFY TP_DATA.
    E_T_DATA-MATNR =   TP_DATA-MATNR.
    E_T_DATA-KSCHL =   TP_DATA-KSCHL.
    E_T_DATA-KHETR =   TP_DATA-KHETR.
    E_T_DATA-KBETR =   TP_DATA-KBETR.
    E_T_DATA-KMEIN =   TP_DATA-KMEIN.
    E_T_DATA-DATAB =   TP_DATA-DATAB.
    E_T_DATA-DATBI =   TP_DATA-DATBI.
    APPEND E_T_DATA.
        CLEAR WA_MARM1.
        CLEAR WA_MARM2.
      ENDLOOP.
    Edited by: Shen Peng on Oct 20, 2010 10:09 AM

  • Reg: function module to fetch the overall taxs for  a sales order

    Hi Experts,
    I need a fuction module which fetches all the taxes for a sales order with the tax values.
    (i.e) i need a function module with displays the overall tax values and not line itemwise..
    Regards,
    Vikram.S

    Hi,
    Check if it works
    POS_SALES_DOCUMENT_HEAD_TAXES

  • Function module to fetch data from table

    Hi All,
    I want to get the entries from the table 'arfcsstate'  for a particular date. Is there a function module to get the same.
    Thanks in advance.
    Regards,
    Anju

    Hi,
    You can use select query
    Select * from arfcsstate into <Internal table name>
    where date <give ur condition.>
    if date is in selection screen than write
    date in s_date.
    Thanx
    Ankur Sharma

  • Service call to function module not fetching data

    Hello Experts,
    Today, I have started facing one more weird issue of the similar kind, I faced few weeks back.
    Once my web dynpro application is loaded, on the click of button I make a service call to function module which brings me some data and that is being shown on the UI.
    After doing few more service calls on the click of other buttons, when I click on the button initially clicked, service call is being made but no data is being returned.
    I already debugged the code, made sure the parameters is being passed correctly to function module.
    Regards,
    Harsh

    Hello Katrice,
    I debugged to the hilt and found that standard function module 'ME_REL_ACTIVE' was returning sy-subrc non zero.
    I cleared one variable after identifying it. Below is the code snippet:
        ld_read_t16fg = '(SAPLEBNF)READ_T16FG'.
        ASSIGN (ld_read_t16fg) TO <lst_read_t16fg>.
        IF <lst_read_t16fg> IS ASSIGNED AND <lst_read_t16fg> IS NOT INITIAL.
          CLEAR <lst_read_t16fg>.
        ENDIF.
        UNASSIGN <lst_read_t16fg>.
    Regards,
    Harsh

  • Function module to fetch data from table SETLEAVES

    Hi All,
    We have a requirement to fetch the data from table SETLEAVES based on the setclass,subclass and group. As the table holds hierarchical data, Please let me know a FM which fetches all the hierarchical data from the table SETLEAVES.
    Regards
    Shiva

    Try:
        exporting
          e_class                     = '0102'
          e_setid                     = setid
          e_kokrs                     = my_kokrs
          e_mandt                     = sy-mandt
          e_master_data               = 'XXX'
          e_structure                 = 'X  X0200'
          e_replace_class             = space
          e_replace_unit              = space
          e_suffix                    = space
          e_old_line_level            = 1  "l_ol_level
        tables
          t_nodes                     = it_ceg_nodes
          t_values                    = it_ceg_values
        changing
          c_info                      = c_info
          c_overwrite                 = c_overwrite
        exceptions
          no_controlling_area         = 1
          no_chart_of_account         = 2
          different_controlling_areas = 3
          different_chart_of_accounts = 4
          set_not_found               = 5
          illegal_field_replacement   = 6
          illegal_table_replacement   = 7
          fm_raise                    = 8
          convert_error               = 9
          no_overwrite_standard_hier  = 10
          no_bukrs_for_kokrs          = 11
          others                      = 12.
    Rob

  • Function Module to find date by passign the Planning Calendar

    Hi All,
    Can you tell me is there any function Module to find date by passign the Planning Calendar?
    The requirement is i have a planning calender assigned to the Material in the MRP2 view.
    Example: Material XXXXXX is assigned a Planning Calendar Z01.
    Z01 is defined such that Delivery is on Monday only. This calendar says that the material is received from the Vendor only on Mondays.
    So whenever i punch a Sales Order for Material XXXXXX, a PR is automatically geenrated when saving the sales order and the calculation of Delivery dates is also happening at this level.
    Basing on this PR a PO is raised to a Vendor for procuring the Material XXXXXX, now my problem is for example the PO is raised today (30.04.2008), but the Materail XXXXXX is available only on next monday in my plant (05.05.2008) basing on my Planning Calendar assigned in the Materail Master, so i have to inform this dealy to my customer at the time of punching the sales order.
    So is there any function Module to find date by passign the Planning Calendar?
    Thanks for your valuable inputs.
    Regards,
    Sudarshan

    Hi Jorge,
    Thanks for your reply.
    I am unable to open the Function module which you have mentioned below.
    I am working on 4.6 c version of SAP.
    Any ways i have found one function module which is useful to my requirement as stated below:
    DATE_GET_PERIOD
    Thanks and Regards,
    Sudarshan

  • Function module to fetch pdf file from App. Server and print/email?

    Hi all,
    Is there any function module to fetch a PDF file from APPLICATION SERVER and print the PDF file or send it as an attachment in an email?
    Please help..
    Thanks in advance.
    Sandeep.

    Hi Sandeep,
    Is there any function module to fetch a PDF file from APPLICATION SERVER
    1) As far as i know there are no FMs to read a file from App server, you can do the same using *OPEN/READ/CLOSE dataset ABAP statements - There are tons of examples for this on the net.
    and print the PDF file or send it as an attachment in an email?
    You can send the file read from the app server(by the suggested method above) and use CL_BCS to send it as an attachment.
    Again there are many examples on the net on how to use CL_BCS for the same.
    Regards,
    Chen

  • Function Module to fetch Partner Functions in PM Notification

    Hi Expert,
    I have one requirement to send mail to M2- Engineering Man in PM Notification after saving.
    So I want to fetch all M2 (Engineering Man i.e. Partner Functions) from that Notification at runtime.
    Right now I am writing the Logic in BADI "NOTIF_EVENT_POST" and I am not getting those M2: Engineering Man in this BADI.
    If anyone know Function Module to fetch Partner Functions at runtime please let me know.
    Thanks,
    Jay.

    Hello,
    Did you find any function module for updating the Partner address in the Notificaton
    Regards,
    sks.

  • Function Module to Compare Date within date Range

    Hi All,
            Does anyone know Function Module to Compare Date within date Range...For example i need to find whether 08/02/2006 falls in between 07/15/2006 and 09/15/2006......

    data: datum type sy-datum value '20070802',
          datum_low type sy-datum  value '20070730',
          datum_high type sy-datum value '20070930'.
    If datum between datum_low and datum_high.
    Endif.
    Regards,
    Rich Heilman

  • Function module to convert date form yyyy/mm/dd to dd/mm/yyyy format

    Can any one tell me Function module to convert date form yyyy/mm/dd to dd/mm/yyyy format?

    have a look at the WIKI FAQs...they are very useful
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/abap/abapDevelopmentand+Programming&
    For this it says:
    <i>How to convert a date to internal or external format?
    Use the functions modules CONVERT_DATE_TO_EXTERNAL or CONVERT_DATE_TO_INTERNAL
    to convert the date. When converting to external format, the date format from the user's user profile will be used. When converting to internal format, the result will be in YYYYMMDD format.</i>

  • Function Module to convert date to week from Sunday to Saturday

    Hi,
    In BW the convertion date to week always give week from Monday(1) to Sunday(7)
    I'm looking for a function module to convert date to week from Sunday(1) to Saturday(7)
    Thanks
    Sebastien

    Hi,
    I think this SAP standardized. Maybe you need to create custom FM.
    You can copy SAP FM DATE_GET_WEEK. in the FORM FIRSTWEEK, I see below case,
    CASE start_weekday.
        WHEN if_calendar_definition=>c_monday.
          start_weekday_number = 1.
        WHEN if_calendar_definition=>c_tuesday.
          start_weekday_number = 2.
        WHEN if_calendar_definition=>c_wednesday.
          start_weekday_number = 3.
        WHEN if_calendar_definition=>c_thursday.
          start_weekday_number = 4.
        WHEN if_calendar_definition=>c_friday.
          start_weekday_number = 5.
        WHEN if_calendar_definition=>c_saturday.
          start_weekday_number = 6.
        WHEN if_calendar_definition=>c_sunday.
          start_weekday_number = 7.
      ENDCASE.
    Maybe you can play something here.

  • Function module to Read DATA from HRP1001

    Hi All ,
        I am fetching sobid by writing the following Select Query,
    <b>      SELECT sobid FROM hrp1001 INTO TABLE it_sobid
             WHERE otype = c_objtyp_o
             AND   objid = pr_ounit
             AND   plvar = c_plnvrsn
             AND   rsign = c_relshp_b
             AND   relat = c_relat_963
             AND   sclas = c_objtyp_s.</b>
    is there any Function module to fetch the data from HRP1001 using all the above selection Criteria.
    Thanx,
    Girish.

    RH_READ_INFTY_1001
    Raja

  • Function Module to get ABAP source code for a specific version

    Hi all
    Is there a function module that I can use to get the source code of another function module at a specific version?
    For example, can I call a function module passing in "FM_NAME" and "FM_VERSION" and have it return the lines of code associated with that object?
    Thanks in advance.
    Stuart

    Thanks guys
    That's incredibly helpful! I have one more question that I just thought of last night...
    Is there a way to hook into the code activation process? I want to be able to take a snapshot of the ABAP source code at each point when it is activated for use in another system, but need to be able to intercept this event and get the source code at that point in time.
    Any ideas?
    Thanks!

  • Program or Function module to delete data from Open Hub Destination Table

    Hi All,
    Can anybody suggest me a Program or Function module to delete data from Open Hub Destination Table.
    Thanks & Regards,
    Vinay Kumar

    You can simply goto t-code SE14 mention the open hub destination table and Delete data by clicking on "Activate and Adjust database" with radio button "Delete Data".
    Regards,
    Arminder

Maybe you are looking for

  • After I Update to IOS 7.1 I can't open the excel file attached in  my email

    After I updated my Iphone 5s from IOS7.0.6 to IOS7.1 when i check my email i can't open excel file attached in my email i check with my frineds phone thy have same issoue

  • Documents won't go away?

    When I delete a document from Pages on my iPad an older version comes back from the Cloud. How do I delete a document from all devices and the Cloud?

  • Error editing a task

    when i am editing a task , this is the error i am getting , can any one help me out The task with the name "Make dimension Task" and the creation name "OSoft.Services.Application.DataMgr.Task.SSISTaskMakeDim, OSoftTaskMakeDim, Version=4.2.0.400, Cult

  • BarChart Update

    Hello I'am facing a rather big problem, that is I have a  Barchart that is linked to two buttons !! For the time, let's say that the barchart is getting data of the current year and that the two buttons contol either the chart updates to the next yea

  • Can't read txt or pdf files?

    I've been unsuccessfully trying to view these two most popular text files on my iPod touch. I thought that considering the size of the screen as well as ebook capability, formats like pdf and txt would surely be supported. Is it just me? Maybe I can'