Use of BADI /SAPAPO/SDP_RELDATA METHOD CHANGE_PROD_LOC

We have a requirement for a small number of product/locations to re-direct them onto a customer location when releasing the forecasts to SNP.
We have been pointed in the direction of the BADI /SAPAPO/SDP_RELDATA method CHANGE_PROD_LOC.
Unfortunately we can not find any documentation on the use of this BADI/Method, we've tried to change the location using the parameter CT_MATID_LOCID, also setting the parameter CV_CHANGE_PROD_LOC where a change has been made, but it doesn't seem to work.
Has anyone used this BADI/Method and has advice on it's usage?
Regards, Mark

Hi Mark - Changing the CT_MATID_LOCID table alone will not associate the change with a plobj or CV. I am surprised you do not get an error. You will also need to update the CT_MATLOC_PLOBJ table - find the entry for the old matid/locid then update that with the new matid/locid. Also the CT_PLOBJ_CHAR table needs to be updated as well - find the same plobj and update matid/locid accordingly.
Regards
Andy

Similar Messages

  • BADI /SAPAPO/SDP_INTERACT (Method 'DVIEW_DISPLAY_MODE_SET)

    Hi All,
    Is there a way to restrict the planners have both change /display access in 001(sim version) and selected planners to have display only acesss in 000 (active version).
    I went through the BADI /SAPAPO/SDP_INTERACT (Method 'DVIEW_DISPLAY_MODE_SET) info. It says that the display/change mode can be altered for specific users with the user parameter '/SAPAPO/SDP94_D_MODE'/.
    Can this be done?  and if so pls give me the steps to make changes in  BADI and implement it.
    Thanks in advance for your help and support.
    Kind Regards,
    SSP

    Hi,
    You need to give this BADI  /SAPAPO/SDP_INTERACT name to your developer, he / she should be able to imlement and write the code according to your need.
    See OSS note 401830 for parameter id.
    user parameter '/SAPAPO/SDP94_D_MODE'
    Parameter:
    - I (Initial)Started in display mode, switch to change mode possible
    - A (Always)Started in display mode, switch to change mode not possible
    - C (Change)Started in change mode (if the planning book/ data view permits the change mode)
    cheers
    Pavan Verma

  • APO DP - use of BADI /sapapo/sdp_fcst4

    I am wanting to use BADI /sapapo/sdp_fcst4 to store forecast errors in mass processing.
    My question is:
    How do I see/use these stored forecast errors when I am working in interactive DP.
    Thanks,
    Bob Austin, Atos Origin

    Dear Bob
    I suggest you to check this document: to extract the forecasting results from SAP APO
    I also suggest you to look at this [thread: APO DP - BADI for storing forecast error in mass processing.|;
    Best regards,
    Carlos Eduardo Rodríguez

  • Split SNP PDS using BADI /SAPAPO/CURTO_SNP Method CIF_IMPORT

    Hello APO ABAP experts,
    The requirement is to split SNP PDS based on the number of modes. Meaning, the PDS should have only Mode per Activity in the Operations.
    My plan was to change the changing internal tables in the method CIF_IMPORT to create number of SNP PDS depending up on Modes. But, i am not sure whether it is possible or not. Please suggest.
    Note: BADI will be triggered once per each PDS.
    Thanks,
    Shaun.

    Saurabh,
    Let me explain you what i am doing:
    Since i need to split one PDS into multiple PDS, I am changing the fields EXT_PLANNR and EXT_NAME just by appending a counter. Once after i change them, adding the entries to the changing internal tables (CT_*). At the end of CIF_IMPORT, i am deleting the original PDS entries.
    Example code:
      LOOP AT ct_planactz INTO ls_planactz.
        ls_planactz-ext_plannr = lv_new_ext_plannr.
        APPEND ls_planactz TO lt_planactz.
      ENDLOOP.
      APPEND LINES OF lt_planactz TO ct_planactz.
    Right now, for testing purpose - i am not splitting the PDS. I am just trying to create 2 SNP PDS by using one PDS. I want to test my code first to create multiple PDS.
    When doing this, i get the following error:
    Error: Activity 250006007010001-012 000600000004 P  does not exist
    Message no. /SAPAPO/CURTO005
    Piece of standard code cuasing the problem:
    LN 64 in method GET_APO_GUIDS.
        READ TABLE ct_cif_planactz INTO ls_cif_planactz
                  WITH KEY actnr   = ls_apo_planactz-r3actnr
                           plnkn   = ls_apo_planactz-plnkn
                           zaehl   = ls_apo_planactz-zaehl
                           phasenr = ls_apo_planactz-phasenr
                           uvorn   = ls_apo_planactz-uvorn
                  BINARY SEARCH.
    Call stack:
    METHOD     GET_APO_GUIDS
    METHOD     CREATE_RTO
    METHOD     CREATE_SNP_RTO
    FUNCTION     /SAPAPO/CUSLNTRTO_CREATE_RTO
    Question:
    May i know what is the significance of other fields in internal table ct_cif_planactz ? Since i am chaning only EXT_PLANNR field, above binary search is picking up the same entries and ignoring my second PDS.
    I would appreciate if you can share your ideas.
    Thanks,
    Shaun.

  • Badi /SAPAPO/SDP_SELECTOR.

    Hi Techies ,
    I need to add some extra selection fields in the selection window using this badi /SAPAPO/SDP_SELECTOR,and the method used for the selection is F4 .
    Now kindly let me know how to implement this standard badi so that i can do my custom changes to the method .
    In addition to the standard fields available in selection profile, we add these fields for selection in the planning book.
    Implement the definition /SAPAPO/SDP_SELECTOR. Method F4 is triggered when the user clicks on the value help for the additional fields. Method INIT_OBJECT_LIST is triggered when the planning book is loaded using the transaction /SAPAPO/SDP94. Method LOC_PROD_VALUE_LIST is triggered when the user enters the selection criteria in the selection profile and hits ENTER.
    Now let me know how to proceed with this modification using this BADI , swift responses would be really appreciated !!
    Thanks,
    PKP.

    Hi PKP,
    Its not very clear what issue you are facing.
    You need to use the method INIT_OBJECT_LIST if you want to add more selection criteria to the shuffler than the ones available in standard. You can use the method ADD_FIELD_TO_SELECTOR within INIT_OBJECT_LIST to add the new selection criteria.
    By default, you won't see any F4 help against these newly added selection criteria. If you want to add the same, you would need to add code in F4.
    Thanks - Pawan

  • BADI  /SAPAPO/SDP_SAVE

    Hi Experts,
    Please explain me how to use the  BADI
    /SAPAPO/SDP_SAVE.
    I need to work on the method SAVE_CHECK.
    What values will be given to the import parameters IV_PAREAID, IS_WRITE_OPTIONS, IT_SELECTION, IT_PLOB_VALUES and IT_COLS.
    And would be the values returned to CT_LINES and CT_TAB.
    Thanks and would appreciate your help.
    Regards
    Srini

    Hi Visu,
    Thank you very much for the detailed reply.
    I am working as you suggested. I will update the result.
    Actually the pseudo code given to me is:
    BADI name     /SAPAPO/SDP_SAVE
    Method name     SAVE_CHECK
    Parameters:
    IV_PAREAID   Importing (planning area for the source / target
    IS_WRITE_OPTIONS   Importing
    IT_SELECTION  Importing  (looks like this an infoobject so relevant KF)
    IT_PLOB_VALUES       Importing
    IT_COLS              Importing
    CT_LINES                     Changing
    CT_TAB               Changing
    Can we use this BADI for the same requirement?
    Please explain.
    Thanks and would appreciate your help.
    Regards
    Srini

  • BAdi /SAPAPO/SDP_DISTR

    Hello,
    Did anybody used the BAdi /SAPAPO/SDP_DISTR?  Can this be used for defining custom fair share rules in Deployment.
    Please let me know if anybody has used this before and has some insights into this.
    Thanks

    Hi
    I have used BADI /SAPAPO/FS_USER insted of the /SAPAPO/SDP_DISTR for user defined fairshare distribution.
    Regards,
    Raghu.

  • Use of APO BADI /SAPAPO/SNP_ADV_SFT

    I am using APO SNP safety stock planning.
    I want to store the calculated 'demand forecast error' from the safety stock program on a field on the APO product master.
    Is the BADI /SAPAPO/SNP_ADV_SFT suitable for this (method GET_FORECAST_ERROR)?
    Or is there a better approach?
    Thanks for any advice on this...

    Is these products are unique?  If yes, then you can use Location split functionality.

  • Use of BAdi 'WorkOrder_update'(method in_update)

    Hi,
    I am using the badi 'WorkOrder_update' for an enhancement to iw32.I need to check whether new material has been added to order.How will i check that new material has been added to order. There are parameters in this badi which gives us the components list.Will these tables be returning the components which are already existing in the order or the components which the user has entered or changed.
    Please help.

    Hai anu,
    in that badi defination there is a moethod IN_UPDATE in which u have
    IT_HEADER
    IT_HEADER_OLD
    IT_ITEM
    IT_ITEM_OLD
    IT_SEQUENCE
    IT_SEQUENCE_OLD
    IT_OPERATION
    IT_OPERATION_OLD
    IT_COMPONENT
    IT_COMPONENT_OLD
    IT_DOCLINK
    IT_DOCLINK_OLD
    as importing parameters with this u can compare the old and new items for the order.
    If usefull Reward points
    Regards,
    Sree

  • Hide row in planning book using BADI /SAPAPO/ADVX USER_EXIT_MACRO

    Dear All,
       I would like to have your suggestion how to hide row in planning book using BADI USER_EXIT_MACRO
       the requirement is when I drill down the object by region, the first line will be "total" and the second and third line
       will be region like "north" and "south".
       I want to show only "total" line and hide region detail.
       Would it be possible to do this using the badi USER_EXIT_MACRO?
    Thank you in advance,
    Boonsom

    Hi,
    In the Interactive Planning, you see a Cap-like icon on the top-left...... click on it and choose the characteristic (say, region) and say ok. You will then be able to see the Region just on top of the planning table. When you load the data, by default, it will have "Total" as option, and with your wish, you can choose to see the data for a particular region (North, South etc).
    Regards,
    Guru Charan.

  • BAdI /SAPAPO/DM_PO_MNTN - CT_ORDKEY is not populated with the order data for PO Memo

    Dear All,
    I have done enhancement in the ERP system by adding the customer specific field ZZ_RESWK in structure CIFPUORCUS. This field is filled in the ERP user exit EXIT_SAPLMEAP_001, for the Purchase order (category BF & BG) and PO Memo (Category AH).
    Now, in APO I have implemented the BAdI /sapapo/dm_po_mntn, and in the method "Change" I am passing the field zz_reswk to ct_ordkey table field reswk, so to write the field in livecache.
    This set up is working for order category BF and BG. However, when I am transferring the PO memo (Category AH) from ERP to APO, the the BAdI internal table ct_ordkey is having no records. Hence I am not able to write field reswk for the PO memo in the live cache.
    Any one have any idea, why there is not data in ct_ordkey for PO memo ?
    Note: The data transfer from ERP to APO is using IDOC.
    Please Help.
    Regards,
    SC

    Hi,
    If you don't do what I told you, I can not do anything more....
    Your code should look like this:
    loop at it_item into ls_item.
    ls_cust-refobject = 'POITEM'.
    ls_cust-fieldname = 'CATALOGID'.
    ls_cust-REFFIELD1 = 'PO_ITEM'. <b>and not 'POITEM'</b>
    ls_cust-REFVAL1 = ls_item-number_int. <b>and not a fixed value</b>
    ls_cust-container = ls_item-catalogid.
    append ls_cust to ct_bapi_customer_fields.
    endloop.
    For R/3 mapping table BBP_CUFMAP:
    DOC_TYPE = PO
    KEY_TYPE = Z
    CUF_FIELD = CATALOGID
    R3_FIELD = ZSRMCATALOGID
    Rgds
    Christophe

  • Implementation for BADI - /SAPAPO/ADVX

    Hi,
    I have created and activated an implementation for the BADI /SAPAPO/ADVX for the method USER_EXIT_MACRO. But this implementation is not triggering when i execute a macro in Transaction /SAPAPO/SDP94. Could you please let me know how to achieve this? (I am implementing this BADI to display the Units in SUOM instead of Base UOM).
    Do we have any other BADI for changing the stock from UOM to SUOM?
    Thanks,
    Rajinikanth

    Hello Experts,
             I have created one Z class in which i am using the methods of BADI /sapapo/advx , i have hard coded my macro id ,layout id and view id so that it will execute my code on execution of that particular macro.now my problem is how to read the data for particular keyfigure from the internal tables of this interface.i am not getting how to read te data and process it.
    please help me on this.
    Regards,
    Saurabh Kulkarni

  • BADI /SAPAPO/AM_ALERTLIST - How to fill values in new field catalogue

    Hi,
    I need some help for passing values into the field Catalog of an ALERT Monitor.
    The requirement is to add new fields in the ALERT Monitor and then populate them with values form the PRODUCT view.
    I have implemented method MODIFY_ALERTLIST of BADI /SAPAPO/AM_ALERTLIST. I am able to add the new columns but I am unable to add the values. Actually while debugging i found that even though the NEW values are going into the table T_ALERTS, but the space between the New Added values and the original value is HUGE. Therefore when the Field Catalog is displayed in the Alert Monitor, the NEW Values are not shown.
    I am attaching my Code
      DATA: l_table_ref TYPE REF TO data,
      l_table_ref_1 TYPE REF TO data,
      l_fieldcat_str TYPE /sapapo/am_aot_fieldcat_str,
      ls_fieldcat TYPE LINE OF lvc_t_fcat,
      ls_t_fieldcat LIKE LINE OF t_fieldcat,
      l_alert_str TYPE LINE OF /sapapo/alert_tab,
      l_str_ref TYPE REF TO data,
      l_str_ref_1 TYPE REF TO data.
      FIELD-SYMBOLS: <aot_tab> TYPE STANDARD TABLE,
      <aot_tab_1> TYPE STANDARD TABLE,
      <alert_str> TYPE /sapapo/alert_str,
      <aot_str> TYPE ANY,
      <alert_str1> TYPE c,
      <alert_str_uc> TYPE c.
      FIELD-SYMBOLS: <zat103> TYPE c. "ANY.
      DATA : l_col_pos TYPE i,
      gv_entries TYPE i,
      xlength TYPE i.
      FIELD-SYMBOLS : <info> TYPE ANY,
                      <aot_str1> TYPE ANY.
      DATA olen1 TYPE i.
      DATA: t_pegid TYPE STANDARD TABLE OF /sapapo/amopegid_tab,
            t_ordid TYPE STANDARD TABLE OF /sapapo/amoordid_tab.
      CLEAR: l_alert_str,
        l_table_ref ,
        l_table_ref_1 ,
        l_fieldcat_str ,
        ls_fieldcat ,
        ls_t_fieldcat ,
        l_str_ref  .
    *Add new column
      READ TABLE t_fieldcat INTO ls_t_fieldcat INDEX 1.
      DATA: x1 TYPE lvc_t_fcat,
           y1 LIKE LINE OF x1.
      x1 = ls_t_fieldcat-fieldcat.
      LOOP AT x1 INTO y1 WHERE reptext NE space.
        CHECK y1-fieldname NE 'DELIVERY_DATE'.
        xlength = xlength + y1-intlen.
      ENDLOOP.
      DESCRIBE TABLE  x1 LINES gv_entries.
    Appending Delivery Date
      ls_fieldcat-col_pos = gv_entries + 1.
      ls_fieldcat-fieldname = 'DELIVERY_DATE'.
      ls_fieldcat-ifieldname = 'DELIVERY_DATE'.
      ls_fieldcat-tabname = '1'.
      ls_fieldcat-seltext = 'Delivery Date'.
      ls_fieldcat-outputlen = '10'.
    ls_fieldcat-rollname = '/SAPAPO/DELIVERY_DATE' . "'DATS'.
      ls_fieldcat-domname = '/SAPAPO/CHAR20'."'/SAPAPO/DATUM'.
      ls_fieldcat-coltext = 'Delivery Date'.
      APPEND ls_fieldcat TO ls_t_fieldcat-fieldcat.
    Appending Start Date
      ls_fieldcat-col_pos = gv_entries + 2.
      ls_fieldcat-fieldname = 'STARTDAT'.
      ls_fieldcat-tabname = '1'.
      ls_fieldcat-seltext = 'Start Date'.
      ls_fieldcat-outputlen = '10'.
      ls_fieldcat-rollname = 'DATS'.
      ls_fieldcat-domname = '/SAPAPO/DATUM'.
      ls_fieldcat-coltext = 'Start Date'.
      APPEND ls_fieldcat TO ls_t_fieldcat-fieldcat.
    Appending Required Shelf Life Date
      ls_fieldcat-col_pos = gv_entries + 3.
      ls_fieldcat-fieldname = 'SL_MIN_DAT'.
      ls_fieldcat-tabname = '1'.
      ls_fieldcat-seltext = 'Req.SL dte'.
      ls_fieldcat-outputlen = '10'.
      ls_fieldcat-rollname = 'DATS'.
      ls_fieldcat-domname = '/SAPAPO/DATUM'.
      ls_fieldcat-coltext = 'Req.SL dte'.
      APPEND ls_fieldcat TO ls_t_fieldcat-fieldcat.
    Appending Shelf Life Date/Required Maximum Shelf life Date
      ls_fieldcat-col_pos = gv_entries + 4.
      ls_fieldcat-fieldname = 'SL_MAX_DAT'.
      ls_fieldcat-tabname = '1'.
      ls_fieldcat-seltext = 'SL Date 2'.
      ls_fieldcat-outputlen = '10'.
      ls_fieldcat-rollname = 'DATS'.
      ls_fieldcat-domname = '/SAPAPO/DATUM'.
      ls_fieldcat-coltext = 'SL Date 2'.
      APPEND ls_fieldcat TO ls_t_fieldcat-fieldcat.
    Appending (Availability/Requirements) Date of a Schedule Line
      ls_fieldcat-col_pos = gv_entries + 5.
      ls_fieldcat-fieldname = 'AVL_REQ_DATE'.
      ls_fieldcat-tabname = '1'.
      ls_fieldcat-seltext = 'Schedule Date'.
      ls_fieldcat-outputlen = '10'.
      ls_fieldcat-rollname = 'DATS'.
      ls_fieldcat-domname = '/SAPAPO/DATUM'.
      ls_fieldcat-coltext = 'Schedule Date'.
      APPEND ls_fieldcat TO ls_t_fieldcat-fieldcat.
    Appending Req Date/ Shipment end date
      ls_fieldcat-col_pos = gv_entries + 6.
      ls_fieldcat-fieldname = 'SHIP_MAX_DATE'.
      ls_fieldcat-tabname = '1'.
      ls_fieldcat-seltext = 'Req Date/ Shipment end date'.
      ls_fieldcat-outputlen = '10'.
      ls_fieldcat-rollname = 'DATS'.
      ls_fieldcat-domname = '/SAPAPO/DATUM'.
      ls_fieldcat-coltext = 'Req Date/ Shipment end date'.
      APPEND ls_fieldcat TO ls_t_fieldcat-fieldcat.
    Appending Expected Grading Date
      ls_fieldcat-col_pos = gv_entries + 7.
      ls_fieldcat-fieldname = 'GRAD_DATE'.
      ls_fieldcat-tabname = '1'.
      ls_fieldcat-seltext = 'Expected Grading Date'.
      ls_fieldcat-outputlen = '10'.
      ls_fieldcat-rollname = 'DATS'.
      ls_fieldcat-domname = '/SAPAPO/DATUM'.
      ls_fieldcat-coltext = 'Expected Grading Date'.
      APPEND ls_fieldcat TO ls_t_fieldcat-fieldcat.
    Appending Available Date
      ls_fieldcat-col_pos = gv_entries + 8.
      ls_fieldcat-fieldname = 'AVAIL_DATE'.
      ls_fieldcat-tabname = '1'.
      ls_fieldcat-seltext = 'Available Date'.
      ls_fieldcat-outputlen = '10'.
      ls_fieldcat-rollname = 'DATS'.
      ls_fieldcat-domname = '/SAPAPO/DATUM'.
      ls_fieldcat-coltext = 'Available Date'.
      APPEND ls_fieldcat TO ls_t_fieldcat-fieldcat.
      MODIFY TABLE t_fieldcat FROM ls_t_fieldcat.
      DATA lvc_t_fcat TYPE lvc_t_fcat.
    *CODE FOR ADDING THE NEW VALUES*
    ASSIGN Alert Structure to Field Symbols for Unicode
      ASSIGN COMPONENT 0 OF STRUCTURE l_alert_str
                         TO            <alert_str>           CASTING.
      CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
          it_fieldcatalog = ls_t_fieldcat-fieldcat
        IMPORTING
          ep_table        = l_table_ref.
    *assign dynamic structure
      ASSIGN l_table_ref->* TO <aot_tab>.
      CREATE DATA l_str_ref LIKE LINE OF <aot_tab>.
      ASSIGN l_str_ref->* TO <aot_str>.
      ASSIGN l_str_ref->* TO <alert_str_uc> CASTING.
      LOOP AT t_alerts INTO l_alert_str.
       READ TABLE t_fieldcat WITH KEY aot = l_alert_str-aot
       INTO l_fieldcat_str.
       CALL FUNCTION '/SAPAPO/ATAB_FIELDCAT_GET'
         EXPORTING
           aot        = l_fieldcat_str-aot
           mview      = l_fieldcat_str-mview
         IMPORTING
           table_ref  = l_table_ref
           t_fieldcat = lvc_t_fcat.
        ASSIGN l_alert_str TO <alert_str>.
    *copy alert to aot-specific structure
        MOVE <alert_str>-info TO <alert_str_uc>.
    *Write this code inside the loop
        ASSIGN COMPONENT 'DELIVERY_DATE' OF STRUCTURE <aot_str> TO <zat103>.  "CASTING.
        IF sy-subrc = 0.
          CLEAR <zat103>.
    *Fetch ur own custom value and move to the field symbol. This
    *dynamically populates ur structure.
          <zat103> = '22.11.1999'.
        ENDIF.
        ASSIGN COMPONENT 'STARTDAT' OF STRUCTURE <aot_str> TO <zat103> CASTING.
        IF sy-subrc = 0.
          CLEAR <zat103>.
    *Fetch ur own custom value and move to the field symbol. This
    *dynamically populates ur structure.
          <zat103> = '22.11.1999'.
        ENDIF.
        ASSIGN COMPONENT 'SL_MIN_DAT' OF STRUCTURE <aot_str> TO <zat103> CASTING.
        IF sy-subrc = 0.
          CLEAR <zat103>.
    *Fetch ur own custom value and move to the field symbol. This
    *dynamically populates ur structure.
          <zat103> = '22.11.1999'.
        ENDIF.
        ASSIGN COMPONENT 'SL_MAX_DAT' OF STRUCTURE <aot_str> TO <zat103> CASTING.
        IF sy-subrc = 0.
          CLEAR <zat103>.
    *Fetch ur own custom value and move to the field symbol. This
    *dynamically populates ur structure.
          <zat103> = '22.11.1999'.
        ENDIF.
        ASSIGN COMPONENT 'AVL_REQ_DATE' OF STRUCTURE <aot_str> TO <zat103> CASTING.
        IF sy-subrc = 0.
          CLEAR <zat103>.
    *Fetch ur own custom value and move to the field symbol. This
    *dynamically populates ur structure.
          <zat103> = '22.11.1999'.
        ENDIF.
        ASSIGN COMPONENT 'SHIP_MAX_DATE' OF STRUCTURE <aot_str> TO <zat103> CASTING.
        IF sy-subrc = 0.
          CLEAR <zat103>.
          <zat103> = '22.11.1999'.
        ENDIF.
        ASSIGN COMPONENT 'GRAD_DATE' OF STRUCTURE <aot_str> TO <zat103> CASTING.
        IF sy-subrc = 0.
          CLEAR <zat103>.
    *Fetch ur own custom value and move to the field symbol. This
    *dynamically populates ur structure.
          <zat103> = '22.11.1999'.
        ENDIF.
        ASSIGN COMPONENT 'AVAIL_DATE' OF STRUCTURE <aot_str> TO <zat103> CASTING.
        IF sy-subrc = 0.
          CLEAR <zat103>.
    *Fetch ur own custom value and move to the field symbol. This
    *dynamically populates ur structure.
          <zat103> = '22.11.1999'.
        ENDIF.
        MOVE <alert_str_uc> TO <alert_str>-info.
        MODIFY t_alerts FROM l_alert_str INDEX sy-tabix.
        CLEAR : <alert_str>, <alert_str_uc>.
      ENDLOOP.
    I have even tried Concatenating Values,  with that method even though the NEW Values are available but they do not fall under the correct Column.
    PLEASE help me out cos I am really Stuck.
    Regards
    Abhishek Sahi

    Hi,
    I need some help for passing values into the field Catalog of an ALERT Monitor.
    The requirement is to add new fields in the ALERT Monitor and then populate them with values form the PRODUCT view.
    I have implemented method MODIFY_ALERTLIST of BADI /SAPAPO/AM_ALERTLIST. I am able to add the new columns but I am unable to add the values. Actually while debugging i found that even though the NEW values are going into the table T_ALERTS, but the space between the New Added values and the original value is HUGE. Therefore when the Field Catalog is displayed in the Alert Monitor, the NEW Values are not shown.
    I am attaching my Code
      DATA: l_table_ref TYPE REF TO data,
      l_table_ref_1 TYPE REF TO data,
      l_fieldcat_str TYPE /sapapo/am_aot_fieldcat_str,
      ls_fieldcat TYPE LINE OF lvc_t_fcat,
      ls_t_fieldcat LIKE LINE OF t_fieldcat,
      l_alert_str TYPE LINE OF /sapapo/alert_tab,
      l_str_ref TYPE REF TO data,
      l_str_ref_1 TYPE REF TO data.
      FIELD-SYMBOLS: <aot_tab> TYPE STANDARD TABLE,
      <aot_tab_1> TYPE STANDARD TABLE,
      <alert_str> TYPE /sapapo/alert_str,
      <aot_str> TYPE ANY,
      <alert_str1> TYPE c,
      <alert_str_uc> TYPE c.
      FIELD-SYMBOLS: <zat103> TYPE c. "ANY.
      DATA : l_col_pos TYPE i,
      gv_entries TYPE i,
      xlength TYPE i.
      FIELD-SYMBOLS : <info> TYPE ANY,
                      <aot_str1> TYPE ANY.
      DATA olen1 TYPE i.
      DATA: t_pegid TYPE STANDARD TABLE OF /sapapo/amopegid_tab,
            t_ordid TYPE STANDARD TABLE OF /sapapo/amoordid_tab.
      CLEAR: l_alert_str,
        l_table_ref ,
        l_table_ref_1 ,
        l_fieldcat_str ,
        ls_fieldcat ,
        ls_t_fieldcat ,
        l_str_ref  .
    *Add new column
      READ TABLE t_fieldcat INTO ls_t_fieldcat INDEX 1.
      DATA: x1 TYPE lvc_t_fcat,
           y1 LIKE LINE OF x1.
      x1 = ls_t_fieldcat-fieldcat.
      LOOP AT x1 INTO y1 WHERE reptext NE space.
        CHECK y1-fieldname NE 'DELIVERY_DATE'.
        xlength = xlength + y1-intlen.
      ENDLOOP.
      DESCRIBE TABLE  x1 LINES gv_entries.
    Appending Delivery Date
      ls_fieldcat-col_pos = gv_entries + 1.
      ls_fieldcat-fieldname = 'DELIVERY_DATE'.
      ls_fieldcat-ifieldname = 'DELIVERY_DATE'.
      ls_fieldcat-tabname = '1'.
      ls_fieldcat-seltext = 'Delivery Date'.
      ls_fieldcat-outputlen = '10'.
    ls_fieldcat-rollname = '/SAPAPO/DELIVERY_DATE' . "'DATS'.
      ls_fieldcat-domname = '/SAPAPO/CHAR20'."'/SAPAPO/DATUM'.
      ls_fieldcat-coltext = 'Delivery Date'.
      APPEND ls_fieldcat TO ls_t_fieldcat-fieldcat.
    Appending Start Date
      ls_fieldcat-col_pos = gv_entries + 2.
      ls_fieldcat-fieldname = 'STARTDAT'.
      ls_fieldcat-tabname = '1'.
      ls_fieldcat-seltext = 'Start Date'.
      ls_fieldcat-outputlen = '10'.
      ls_fieldcat-rollname = 'DATS'.
      ls_fieldcat-domname = '/SAPAPO/DATUM'.
      ls_fieldcat-coltext = 'Start Date'.
      APPEND ls_fieldcat TO ls_t_fieldcat-fieldcat.
    Appending Required Shelf Life Date
      ls_fieldcat-col_pos = gv_entries + 3.
      ls_fieldcat-fieldname = 'SL_MIN_DAT'.
      ls_fieldcat-tabname = '1'.
      ls_fieldcat-seltext = 'Req.SL dte'.
      ls_fieldcat-outputlen = '10'.
      ls_fieldcat-rollname = 'DATS'.
      ls_fieldcat-domname = '/SAPAPO/DATUM'.
      ls_fieldcat-coltext = 'Req.SL dte'.
      APPEND ls_fieldcat TO ls_t_fieldcat-fieldcat.
    Appending Shelf Life Date/Required Maximum Shelf life Date
      ls_fieldcat-col_pos = gv_entries + 4.
      ls_fieldcat-fieldname = 'SL_MAX_DAT'.
      ls_fieldcat-tabname = '1'.
      ls_fieldcat-seltext = 'SL Date 2'.
      ls_fieldcat-outputlen = '10'.
      ls_fieldcat-rollname = 'DATS'.
      ls_fieldcat-domname = '/SAPAPO/DATUM'.
      ls_fieldcat-coltext = 'SL Date 2'.
      APPEND ls_fieldcat TO ls_t_fieldcat-fieldcat.
    Appending (Availability/Requirements) Date of a Schedule Line
      ls_fieldcat-col_pos = gv_entries + 5.
      ls_fieldcat-fieldname = 'AVL_REQ_DATE'.
      ls_fieldcat-tabname = '1'.
      ls_fieldcat-seltext = 'Schedule Date'.
      ls_fieldcat-outputlen = '10'.
      ls_fieldcat-rollname = 'DATS'.
      ls_fieldcat-domname = '/SAPAPO/DATUM'.
      ls_fieldcat-coltext = 'Schedule Date'.
      APPEND ls_fieldcat TO ls_t_fieldcat-fieldcat.
    Appending Req Date/ Shipment end date
      ls_fieldcat-col_pos = gv_entries + 6.
      ls_fieldcat-fieldname = 'SHIP_MAX_DATE'.
      ls_fieldcat-tabname = '1'.
      ls_fieldcat-seltext = 'Req Date/ Shipment end date'.
      ls_fieldcat-outputlen = '10'.
      ls_fieldcat-rollname = 'DATS'.
      ls_fieldcat-domname = '/SAPAPO/DATUM'.
      ls_fieldcat-coltext = 'Req Date/ Shipment end date'.
      APPEND ls_fieldcat TO ls_t_fieldcat-fieldcat.
    Appending Expected Grading Date
      ls_fieldcat-col_pos = gv_entries + 7.
      ls_fieldcat-fieldname = 'GRAD_DATE'.
      ls_fieldcat-tabname = '1'.
      ls_fieldcat-seltext = 'Expected Grading Date'.
      ls_fieldcat-outputlen = '10'.
      ls_fieldcat-rollname = 'DATS'.
      ls_fieldcat-domname = '/SAPAPO/DATUM'.
      ls_fieldcat-coltext = 'Expected Grading Date'.
      APPEND ls_fieldcat TO ls_t_fieldcat-fieldcat.
    Appending Available Date
      ls_fieldcat-col_pos = gv_entries + 8.
      ls_fieldcat-fieldname = 'AVAIL_DATE'.
      ls_fieldcat-tabname = '1'.
      ls_fieldcat-seltext = 'Available Date'.
      ls_fieldcat-outputlen = '10'.
      ls_fieldcat-rollname = 'DATS'.
      ls_fieldcat-domname = '/SAPAPO/DATUM'.
      ls_fieldcat-coltext = 'Available Date'.
      APPEND ls_fieldcat TO ls_t_fieldcat-fieldcat.
      MODIFY TABLE t_fieldcat FROM ls_t_fieldcat.
      DATA lvc_t_fcat TYPE lvc_t_fcat.
    *CODE FOR ADDING THE NEW VALUES*
    ASSIGN Alert Structure to Field Symbols for Unicode
      ASSIGN COMPONENT 0 OF STRUCTURE l_alert_str
                         TO            <alert_str>           CASTING.
      CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
          it_fieldcatalog = ls_t_fieldcat-fieldcat
        IMPORTING
          ep_table        = l_table_ref.
    *assign dynamic structure
      ASSIGN l_table_ref->* TO <aot_tab>.
      CREATE DATA l_str_ref LIKE LINE OF <aot_tab>.
      ASSIGN l_str_ref->* TO <aot_str>.
      ASSIGN l_str_ref->* TO <alert_str_uc> CASTING.
      LOOP AT t_alerts INTO l_alert_str.
       READ TABLE t_fieldcat WITH KEY aot = l_alert_str-aot
       INTO l_fieldcat_str.
       CALL FUNCTION '/SAPAPO/ATAB_FIELDCAT_GET'
         EXPORTING
           aot        = l_fieldcat_str-aot
           mview      = l_fieldcat_str-mview
         IMPORTING
           table_ref  = l_table_ref
           t_fieldcat = lvc_t_fcat.
        ASSIGN l_alert_str TO <alert_str>.
    *copy alert to aot-specific structure
        MOVE <alert_str>-info TO <alert_str_uc>.
    *Write this code inside the loop
        ASSIGN COMPONENT 'DELIVERY_DATE' OF STRUCTURE <aot_str> TO <zat103>.  "CASTING.
        IF sy-subrc = 0.
          CLEAR <zat103>.
    *Fetch ur own custom value and move to the field symbol. This
    *dynamically populates ur structure.
          <zat103> = '22.11.1999'.
        ENDIF.
        ASSIGN COMPONENT 'STARTDAT' OF STRUCTURE <aot_str> TO <zat103> CASTING.
        IF sy-subrc = 0.
          CLEAR <zat103>.
    *Fetch ur own custom value and move to the field symbol. This
    *dynamically populates ur structure.
          <zat103> = '22.11.1999'.
        ENDIF.
        ASSIGN COMPONENT 'SL_MIN_DAT' OF STRUCTURE <aot_str> TO <zat103> CASTING.
        IF sy-subrc = 0.
          CLEAR <zat103>.
    *Fetch ur own custom value and move to the field symbol. This
    *dynamically populates ur structure.
          <zat103> = '22.11.1999'.
        ENDIF.
        ASSIGN COMPONENT 'SL_MAX_DAT' OF STRUCTURE <aot_str> TO <zat103> CASTING.
        IF sy-subrc = 0.
          CLEAR <zat103>.
    *Fetch ur own custom value and move to the field symbol. This
    *dynamically populates ur structure.
          <zat103> = '22.11.1999'.
        ENDIF.
        ASSIGN COMPONENT 'AVL_REQ_DATE' OF STRUCTURE <aot_str> TO <zat103> CASTING.
        IF sy-subrc = 0.
          CLEAR <zat103>.
    *Fetch ur own custom value and move to the field symbol. This
    *dynamically populates ur structure.
          <zat103> = '22.11.1999'.
        ENDIF.
        ASSIGN COMPONENT 'SHIP_MAX_DATE' OF STRUCTURE <aot_str> TO <zat103> CASTING.
        IF sy-subrc = 0.
          CLEAR <zat103>.
          <zat103> = '22.11.1999'.
        ENDIF.
        ASSIGN COMPONENT 'GRAD_DATE' OF STRUCTURE <aot_str> TO <zat103> CASTING.
        IF sy-subrc = 0.
          CLEAR <zat103>.
    *Fetch ur own custom value and move to the field symbol. This
    *dynamically populates ur structure.
          <zat103> = '22.11.1999'.
        ENDIF.
        ASSIGN COMPONENT 'AVAIL_DATE' OF STRUCTURE <aot_str> TO <zat103> CASTING.
        IF sy-subrc = 0.
          CLEAR <zat103>.
    *Fetch ur own custom value and move to the field symbol. This
    *dynamically populates ur structure.
          <zat103> = '22.11.1999'.
        ENDIF.
        MOVE <alert_str_uc> TO <alert_str>-info.
        MODIFY t_alerts FROM l_alert_str INDEX sy-tabix.
        CLEAR : <alert_str>, <alert_str_uc>.
      ENDLOOP.
    I have even tried Concatenating Values,  with that method even though the NEW Values are available but they do not fall under the correct Column.
    PLEASE help me out cos I am really Stuck.
    Regards
    Abhishek Sahi

  • Use of BAdi UC_CTR_XRPROC in Currency Translation

    Hi All,
    Has anyone experience of the BAdi for determining Exchange Rate in BCS?
    In BCS you have the option of customising the Procedure for Exchange Rate Determination by using a Badi, my current client has configured a custom one but I can't view the configuration (due to authorisation frustrations), so I can see that something has been selected but can't see what it is.
    Selected Info from SAP BCS help:
    You can create additional procedures for exchange rate determination in the customer namespace. The custom procedures, along with the standard procedures, are offered for selection in Customizing of currency translation methods.
    If you specify a parameter when creating a procedure for exchange rate determination, this parameter is also offered for selection when the procedure is listed.
    At the time of execution, whenever a custom procedure for exchange rate determination is encountered, the system calls the Business Add-In for exchange rate determination ( UC_CTR_XRPROC). There you can freely determine the exchange rate for each data record being translated.
    Also:
    The E/R determination procedure is the second-last step for determining the value in target currency. (The last step is the currency translation procedure, for which there is also another Business Add-In, UC_CTR_CTPROC.) At this point, the data records to be translated are accessible, and the date of exchange rate determination is known.
    All help will be much appreciated

    Thanks Eugene,
    it appears to have been implemented at one of my current clients but I can't work out what it's doing.
    An old, incomplete configuration document indicates that they were trying to stop the GC figure being updated unless Currency Translation Indicator <> 0 (ie RFD record is not updated by Currency Translation task, GC values are only posted to new records with CT Indicator >0)

  • How can I use my array in another method.... Or better yet, what's wrong?

    I guess I'll show you what I am trying to do rather and then explain it
    public class arraycalc
    int[] dog;
    public void arraycalc()
    dog = new int[2];
    public void setSize(int size)
    dog[1] = size;
    public int getSize()
    return dog[1];
    This gives me a null pointer exception...
    How can I use my array from other methods?

    You have to make the array static. :)
    Although I must admit, this is rather bad usage. What you want to do is use an object constructor to make this class an object type, and then create the array in your main class using this type, and then call the methods from this class to modify your array. Creating the array inside the other method leads to a whole bunch of other stuff that's ... well, bad. :)
    Another thing: Because you're creating your array inside this class and you want to call your array from another class, you need to make the array static; to make it static, you must make your methods static. And according to my most ingenious computer science teacher, STATIC METHODS SUCK. :D
    So, if you want to stick with your layout, it would look like:
    public class arraycalc
         static int[] dog;
         public static void arraycalc()
              dog = new int[2];
         public static void setSize(int size)
              dog[1] = size;
         public static int getSize()
              return dog[1];
    }But I must warn you, that is absolutely horrible code, and you shouldn't use it. In fact, I don't even know why I posted it.
    You should definitely read up on OOP, as this problem would be better solved by creating a new object type.

Maybe you are looking for

  • How fast should I be able to download?

    I have had BT infinity for 2-3 months now, and I never seem to get a download speed of more than 4 megs a second It can start at 6 every once in a while, last about 10 seconds and then quickly run down to 3-4 megs and sit there until the d/l is finis

  • I cannot start weblogic due to IOException

    Hello, Can you tell me how to sole this problem. After starting weblogic , I got an exception : *weblogic.diagnostics.lifecycle.DiagnosticComponentLifecycleException: weblogic.store.PersistentStoreException: java.io.IOException: [Store:280021]There w

  • Statistical value GRWR is 0 in STO- it should be equal to material cost

    Hi I am using STOs (Stock transport orders with customized document type) within EU, crossing the borders of EU countries. GRWR value on STO is 0 due to Z calculation schema (which reads PIR condition type but it does not pass this value to GRWR). I

  • Best Way to Export PDF for Press w/ Grayscale Images

    Hi, we've been trying to move to a PDF based workflow for sending files to printers if possible so that all color conversion can take place at the final step of creating the PDF. This way, all images can remain RGB in their native color space. But I

  • Kensington FM transmitter does not charge Nano-  What gives

    Hey. I have this perfectly good Kensington Model K33199US FM transmitter, that played my old iPod through my car radio while charging it. With my new 5th gen nano, it still plays my tunes through the radio, but no longer charges the iPod. I get a mes