Update routine to populate value for field ZDOCCATG(Document category)

Hi Experts,
   I need to populate  data for field ZDOCCATG(Document Category) based on the value of the below  two fields,
1. 0deb_cre_lc(Debit / credit Amount)
2. 0ac_doc_typ(Belegart)
The logic is as follows:
if 0deb_cre_lc > '0'.
     if 0ac_doc_typ == 'dz'.
      ZDOCCATG = Disputes.
     else
  ZDOCCATG = Invoices.
   end If.
else
if 0ac_doc_typ < '0'.
ZDOCCATG = Credits.
end if.
I need to write the update routine to get the values assigned for Document category based on these two fields. When i open the routine for the field ZDOCCATG, i can see the below screen:
PROGRAM UPDATE_ROUTINE.
$$ begin of global - insert your declaration only below this line  -
TABLES: ...
DATA:   ...
$$ end of global - insert your declaration only before this line   -
FORM compute_data_field
  TABLES   MONITOR STRUCTURE RSMONITOR "user defined monitoring
  USING    COMM_STRUCTURE LIKE /BIC/CS80FIAR_O03 - (Communication structure)
           RECORD_NO LIKE SY-TABIX
           RECORD_ALL LIKE SY-TABIX
           SOURCE_SYSTEM LIKE RSUPDSIMULH-LOGSYS
  CHANGING RESULT LIKE /BIC/AZOARFSCM00-/BIC/ZDOCCATG
           RETURNCODE LIKE SY-SUBRC "Do not use!
           ABORT LIKE SY-SUBRC. "set ABORT <> 0 to cancel update
$$ begin of routine - insert your code only below this line        -
fill the internal table "MONITOR", to make monitor entries
result value of the routine
  RESULT = .
if abort is not equal zero, the update process will be canceled
  ABORT = 0.
$$ end of routine - insert your code only before this line         -
ENDFORM.
Please let me know the code to be inserted (based on the logic mentioned above) in the above screen . Thanks
Regards,
Kavitha Jagannath

Hi Kavitha,
      Supposing the technical name of fields is /bic/0deb_cre_lc and /bic/0ac_doc_typ use the code below at the marked position.
PROGRAM UPDATE_ROUTINE.
$$ begin of global - insert your declaration only below this line -
TABLES: ...
DATA: ...
$$ end of global - insert your declaration only before this line -
FORM compute_data_field
TABLES MONITOR STRUCTURE RSMONITOR "user defined monitoring
USING COMM_STRUCTURE LIKE /BIC/CS80FIAR_O03 - (Communication structure)
RECORD_NO LIKE SY-TABIX
RECORD_ALL LIKE SY-TABIX
SOURCE_SYSTEM LIKE RSUPDSIMULH-LOGSYS
CHANGING RESULT LIKE /BIC/AZOARFSCM00-/BIC/ZDOCCATG
RETURNCODE LIKE SY-SUBRC "Do not use!
ABORT LIKE SY-SUBRC. "set ABORT <> 0 to cancel update
$$ begin of routine - insert your code only below this line -
fill the internal table "MONITOR", to make monitor entries
result value of the routine                 
<----- Paste the code below as shown here --->
if comm_structure-/bic/0deb_cre_lc > 0.
  if comm_structure-/bic/0ac_doc_typ == 'DZ'.
   result = 'DISPUTES'.
  else
   result = 'INVOICES'.
  endIf.
elseif comm_structure-/bic/0deb_cre_lc < 0.
  result = 'CREDITS'.
end if.
<----
>
if abort is not equal zero, the update process will be canceled
ABORT = 0.
$$ end of routine - insert your code only before this line -
ENDFORM.
Regards:
Jitendra
Edited by: Jitendra Gupta on Oct 15, 2009 3:05 PM

Similar Messages

  • How to populate values for a new field in target infoprovider

    Hi Experts,
    am new to BI. i would like to know on how to populate values for a new field in the target cube with start rotuine.In my case,  i have a source infoprovider, which has 3 fields and a target infoprovider, which has 5 fields. i need to populate the new 2 fields in start routine. i dont want to populate using Field routine and am using 3.5 version. please assist with code on how to solve this issue.
    Thank you,
    Chitra.
    Edited by: Chitra_BI on Jun 13, 2011 10:23 AM

    Debug the standard code and see where the other fields are getting update. you can use the similar approach and area to code for the new field.
    Regards,
    Lalit Mohan Gupta.

  • Start Routine to Populate Account Group Field from Master data of 0Customer

    Hello Friends. Please help me edit this ABAP code to make it work. I am putting this code in start routine in between two DSO. where I am using the
    Start Routine to Populate Account Group Field from Master data of 0Customer. I do not want to use read from master data functionality since that field 0customer is not there in dso but similar field 0debitor is there. so i want to put this code
    during the load from source DSO to Target DSO.
    Error Explicit length specifications are necessary with types C, P, X, N und
    DATA: L_S_DP_LINE TYPE DATA_PACKAGE_sTRUCTURE.
        types: begin of comp,
         CUSTOMER       type  /BI0/OICUSTOMER,
         ACCNT_GRP          type /BI0/OIACCNT_GRP,
       end of comp.
        DATA: l_S_comp type comp.
        DATA: L_th_COMP TYPE HASHED TABLE OF COMP WITH UNIQUE KEY customer INITIAL SIZE 0.
    IF  L_th_COMP[] IS INITIAL.
    SELECT CUSTOMER ACCNT_GRP FROM /BI0/PCUSTOMER APPENDING CORRESPONDING FIELDS OF TABLE L_th_COMP.
    ENDIF.
    LOOP AT SOURCE_PACKAGE INTO L_S_DP_LINE.
    READ TABLE L_TH_COMP INTO L_S_COMP WITH TABLE KEY CUSTOMER = L_s_DP_LINE-CUSTOMER
    IF SY-SUBRC = 0.
    L_S_DP_LINE-/BIC/ACCNT_GRP = L_S_COMP-/BIC/ACCNT_GRP.
    MODIFY SOURCE_PACKAGE FROM L_S_DP_LINE.
    ENDIF.
    ENDLOOP.
    soniya kapoor
    Message was edited by:
            soniya kapoor

    Hello Wond Thanks for Good Answer and good option, But Client does not like this option and does not like Nav Attribute so he does not want to turn on any Nav Attribute, In general also We hav requirement to read a third table while uploading 1 dso table to 2 dso table,
    so  Please help me edit this ABAP code to make it work. I am putting this code in start routine in between two DSO. where I am using the
    Start Routine to Populate Account Group Field from Master data of 0Customer.
    No syntax Error But during the load it is updating the source table and not the target table. how to define now target table.
    ***SOURCE DSO Table
    types: begin of typ_tgl1.
        include type /BIC/AZDAFIAR000.
        types: end of typ_tgl1.
        types: begin of comp,
         CUSTOMER       type  /BI0/OICUSTOMER,
         ACCNT_GRP          type /BI0/OIACCNT_GRP,
       end of comp.
    DATA: L_th_COMP TYPE HASHED TABLE OF COMP WITH UNIQUE KEY customer
    INITIAL SIZE 0.
      data: wa_itab type COMP.
        data: wa_zdtg type typ_tgl1.
    IF  L_th_COMP[] IS INITIAL.
    ***Master Data Table
    SELECT CUSTOMER ACCNT_GRP FROM /BI0/PCUSTOMER APPENDING CORRESPONDING
    FIELDS OF TABLE L_th_COMP.
    sort L_th_COMP by CUSTOMER.
    ENDIF.
    LOOP AT L_th_COMP into wa_itab.
    select * from /BIC/AZDAFIAR000 into wa_zdtg
                        where DEBITOR  eq wa_itab-CUSTOMER.  *** SOURCE DSO Table
    IF SY-SUBRC = 0.
    wa_zdtg-ACCNT_GRP = wa_itab-ACCNT_GRP.
    MODIFY /BIC/AZDAFIAR000 from wa_zdtg. *** modify SOURCE DSO Table
    ENDIF.
      endselect.
        endloop.
    soniya kapoor

  • Error  Enter a value for field BP_GUID

    I am using MDG  7.0
    When I create a  Request for "Create ERP Customer",
    I then enter data including the sales Area Data and Company Code data
    Then Submit
    at the following approval step , Sales Area data and CC data is missing.
    I get ERROR message  "Enter a value for Field BP_GUID"
    Please advise what Table or T-code am I missing values for .
    Thanks for your assistance,

    hi,
    See the attached screen shot.
    Regards,
    Tushar

  • Default values for fields in infotype 0017

    Is there any way to set default values for fields in infotype 0017? Maybe a
    feature? I'm thinking about defaulting values based on pay scale group.
    Thanks before.

    Hi
    You can implement what i suggested in my previous post.
    Or else, you can do what we did in one of our client requirement.
    We created a custom Ztable where we had defined which value of the the employee grouping to be placed for which record.
    We did that on the basis of the company code fields.
    For eg: IF BUKRS = 'TR01'
    then EE Grp Expense Type = '1'.
    ENDIF.
    Similarly for other fields.
    Hope this helps.
    Harsh

  • FLEET Table, Possible Values For Field IS SI UNIT

    Dear experts,
    While doing analysis on fleet data I realized that for field IS_SI_UNIT (PM: Vehicle Data in SI Unit (e.g. Dimensions)) in table FLEET in two separate systems we have vehicle records set with different entries for this field.
    In one system vehicles are stored with value F: DB Unit set individually (new) 
    and in other one with value Y: DB Unit set through (new)
    Systems are SAP ECC 6.0
    Does anyone know what does it mean and what influence this has? In both systems vehicles are created by end users using standard PM creation transaction and those indicators are set in background while equipment is saved so there is not influence by end user.
    I could not find much information on SAP support portal about meaning behind possible values for field IS_SI_UNIT in table FLEET so was wondering if anyone knows more here?
    Thanks,
    Ivo

    Dear,
    There will not be any impact.Finally system will consider only SI units for fleet equipment consumption calculation.
    Kindly read note:366733 - Equipment/fleet: SI units in table FLEET and  372736 - Equipmt/vehicle:rounding error because of SI units
    It may help you.
    But in my system i can view only "Y"
    Regards,
    Pardhu

  • UDF - Set Valid Values for Field

    I have a UDF created in Marketing Docs / row level called UOM_Ordered (alphanumeric, length 2) using Set Valid Values for Field.  Values are:
    CS
    IN
    DZ
    PC
    Above are CS abrev for Case, IN abrev for Inner, DZ abrev for Dozen .................
    If possible could I have say for example "IN" not to appear in the drop down if the value in OITM (UDF called U_Inner_Qty) is either NULL or a Zero?  It's would be a way to stop mistakes when orders are inputted.
    Any help on this would be appreciated.
    Thks - Scott

    Hello
    You could try the following:
    Insert a formatted search on the field, which contain conditions, ie whether the condition that the value is 0 or null, then bring the required data, while if it is not the case, applies the search formatted with the available data.
    On the other hand, leave the form with all the options for disabled users. The latter through additional authorizations for users
    I hope it will help
    Best regards,

  • FRM-40212: Invalid value for Field SHIP_TO_ADDRESS1on forms OEXOETEL

    I want to customize a form "OEXOETEL". I want to copy some values from another order to a new order.When i navigate to a block LINE i receive this message: "FRM-40212: Invalid value for Field SHIP_TO_ADDRESS1".
    cursor c_order(p_header_id varchar2) is
    select o.sold_to,
    o.order_type,
    o.terms,
    o.ship_from,
    o.SHIP_to_org_id,
    o.ship_to_address1,
    o.ship_to_address5,
    o.customer_number,
    o.invoice_to_org_id,
    o.INVOICE_TO_LOCATION,
    o.SHIP_TO_LOCATION,
    o.invoice_to_address1,
    o.invoice_to_address5,
    o.sold_to_contact
    from oe_order_headers_v o,
    hz_parties hzp
    where hzp.party_name = o.sold_to
    and o.header_id = p_header_id;
    IF l_block_name IN ('ORDER') THEN
    IF p_event = 'WHEN-NEW-RECORD-INSTANCE' THEN
    open c_order(name_in('global.header_id'));
    loop
         fetch c_order into x_order_row;
    exit when c_order%notfound;
         copy(x_order_row.customer_number,'ORDER.CUSTOMER_NUMBER');
         copy(x_order_row.sold_to,'ORDER.SOLD_TO');
    copy(x_order_row.ship_to_org_id,'ORDER.SHIP_TO_ORG_ID');
    copy(x_order_row.SHIP_TO_LOCATION,'ORDER.SHIP_TO_LOCATION');
         copy(x_order_row.ship_to_address5,'ORDER.SHIP_TO_ADDRESS5');
    copy(x_order_row.ship_to_address1,'ORDER.SHIP_TO_ADDRESS1');
    copy(x_order_row.ship_to_address1,'ORDER.SHIP_TO_ADDRESS1_MIR2');
         copy(x_order_row.invoice_to_org_id,'ORDER.INVOICE_TO_ORG_ID');
         copy(x_order_row.invoice_TO_LOCATION,'ORDER.INVOICE_TO_LOCATION');
         copy(x_order_row.invoice_to_address5,'ORDER.INVOICE_TO_ADDRESS5');
    copy(x_order_row.invoice_to_address1,'ORDER.INVOICE_TO_ADDRESS1');
    copy(x_order_row.INVOICE_TO_LOCATION,'ADDRESSES.INVOICE_TO_LOCATION');
         copy(x_order_row.order_type,'ORDER.ORDER_TYPE');
         copy(x_order_row.sold_to_contact,'ORDER.SOLD_TO_CONTACT');
         copy(x_order_row.ship_from,'ORDER.SHIP_FROM');
    end loop;
    close c_order;
    end if;
    end if;

    Review Note: 302613.1 - OEXOEORD: Cannot select List of Values From The Ship To Address1 Field
    https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=302613.1

  • SDIMA: Values for field SUPP_EXIST in condition table CNCCRMPRCUS801 differ

    Hi Experts,
    when checking condition records consistency between CRM and ERP via transacation SDIMA we get the following error for one of the conditon records: 'Values for field SUPP_EXIST in condition table CNCCRMPRCUS801 differ'. Can anybody explain to me where this message could come from? To my understanding field 'SUPP_EXIST' only exists in CRM condition tables for technical reason. So no way to compare this against an ERP condition table field, is there?
    And related to this: I found that this error message is triggered from method CL_CND_DIMA_CRM->COMPARE_MBDOC. As the DIMA-Compare is triggered asynchronously and just setting a break-point is no option therefore, I was wondering if anybody knows a way of debugging this method in order to find out what the coding does in detail before the message is thrown.
    Thanks a lot for your help!
    Cheers,
    Jens

    Hi Brian and the other Experts,
    thanks for your help. Unfortunately, I don't have a single record with this problem but a lot more. So it is not possible to correct this manually. Also, I would not know how to correct this anyhow as I don't understand what field in R/3 should map to field SUPP_EXIST in CRM condition tables. Let me explain:
    From my understanding, in CRM (leave aside scales) we have two database tables for each condition table, a central and a supplemental table. A condition record always creates a data record in the central table and nothing is inserted in the supplemental table in case that the fields form the supplemental table are not needed. However, when there are less common condition features involved (e.g. uppler limits), then an additional data record will be created in the supplemental table with the relevant data. And this is when field SUPP_EXIST comes into play as it is an indicator for the system that a data record exists for that condition record also in the supplemental table.
    The condition record data model in R/3 is completely different. For CRM condition table CNCCRMPRCUS801 the following tables in R/3 are involved: A801, KONH and KONP. And there is a data record for each of them for a given condition record. There is no concept of having a supplemental table as far as I understand it so where exactly would I find this SUPP_EXIST in R/3 so that I can make sure it does not deviate from the data in CRM?
    Would be great if someone could give me another hint. What am I getting wrong?
    Cheers,
    Jens

  • In TXN CO03, extract value for field "To Confirm" under tab "Qty/Activity"

    Hi,
    Can anyone help to extract value for field "To Confirm" under tab "QTY/ACTIVITIES" in tansaction CO03 at operatin level. There are three Activiti (CC-Set-up,CC-Labor Time & CC-Var-OH) under table control Activities. I need value of the field "To Confirm" for CC-Labor Time.
    From where I can fetch this value,
    1. Is this field available in some table?
    2. Is there any FM with which the same can be extracted.
    3. Any other method?
    Regards,
    Bibhuti.
    Edited by: bibhuti kumar on Feb 20, 2008 6:16 AM

    Hi,
    pls use below table's and get detals you want
    AFKO - Order header details
    AFVC - Order operation details
    AFVV - Order operation value/date's/qty details
    the relation is below
    Step1: AFKO; AUFNR-->AFKO-AUFPL
    Step2: AFVC; AFKO-AUFPL = AFVC-AUFPL
    take filed to APLZL,VORNR
    Step3: AFVV;AFKO-AUFPL=AFVV-AUFPL, AFVC-AUFPL = AFVV-AUFPL
    take filed to MGVRG,LMNGA,XMNGA,VGW02
    Step4: (MGVRG - (LMNGA+XMNGA)) * VGW02
    hope this will solve your problem
    Regards,
    Sankaran

  • Purchase value for a particular document type of po

    I need Purchase value for a particular document type of po

    Hi Thanks for the reply. Sum of net order value will give right. Any selections we have to do at headr level ? Does it hold good for SA's also ? Please help

  • Update Routine to populate 0VENDOR from either of the 2 data source fields

    Hi,
    I have a requirement to write an update routine for 0VENDOR based on the below logic :
    Create routines to populated BW Info Object u201CVendoru201D (0VENDOR) based on the following logic:
    IF field u201CVendoru201D (ITM_VENDOR_ID) is populated from data source 0BBP_SC_TD_1, THEN populate 0VENDOR with that value
    ELSE IF u201CPreferred Vendoru201D (ITM_PROPVEN_ID) is populated from data source 0BBP_SC_TD_1, THEN populate 0VENDOR with that value
    ELSE IF neither u201CVendoru201D (ITM_VENDOR_ID) or u201CPreferred Vendoru201D (ITM_PROPVEN_ID) are populated from data source 0BBP_SC_TD_1, then 0VENDOR = NULL
    Can anyone help me in converting this logic into ABAP routine.
    Thanks,
    Suchitra

    Hi Suchitra,
    In the Transfer Rules ... You will be mapping each field then the mapping field click on the button with Triangle then you can see the which type you want.
    Then select the routine and select the datasource fields (don't forget to select the both fields VENDOR and PROPITM)...
    Then give a name to routine ...
    and in the code just change the COMM_STRUCTURE to TRANSFER_STRUCTURE.
    Then you can get this .... done..
    Regards,
    Ravi Kanth

  • End Routine to populate custom AFS field for Billing Item extractor

    I have the following scenario for Billing 2LIS_13_VDITM datasource
    Doc_No   Item  Material    Item_Categ   AFS_field
    2000        11     XYZ          123
    2000        12     XYZ          123                  US1
    3000        11     PQR          456                 
    3000        12     PQR          456                  CA1
    I need to populate the AFS_field in the first row also for all Doc Nos for certain Item categories (eg 123 & 456). I need to do this on the first transformation from PSA to DSO. I was planning to write a SELECT statement in the Start Routine with the PSA table as the reference as seen below and then write an End Routine calling this reference table. But the PSA table name is different in Dev, QA and Prod so I cannot use this.
    TYPES: BEGIN OF S_AFS,
    VBELN TYPE C LENGTH 10,
    PSTYV TYPE C LENGTH 4,
    MATNR TYPE C LENGTH 18,
    J_4KRCAT TYPE C LENGTH 16,
    J_4KSCAT TYPE C LENGTH 16,
    END OF S_AFS.
    DATA: LT_AFS TYPE STANDARD TABLE OF S_AFS,
          LS_AFS TYPE S_AFS.
    DATA: LT_DATA TYPE tyt_SC_1.
    LT_DATA[] = SOURCE_PACKAGE[].
    SORT LT_DATA DESCENDING BY VBELN MATNR J_4KRCAT.
    DELETE ADJACENT DUPLICATES FROM LT_DATA COMPARING VBELN MATNR.
    SELECT VBELN MATNR J_4KRCAT J_4KSCAT
    INTO CORRESPONDING FIELDS OF TABLE LT_AFS
    FROM /BIC/B0000777001
    FOR ALL ENTRIES IN LT_DATA WHERE VBELN = LT_DATA-VBELN AND MATNR =
    LT_DATA-MATNR.
    SORT LT_AFS BY VBELN MATNR.
    I am not an expert in writing ABAP code. Any suggestions are greatly appreciated and points will be assigned. Thank you.

    Hi
    why do want to select the data from PSA table ?Already your trying to load data from PSA to DSO.
    you want to populate the AFS field value in DSO right?
    1. First you have to add AFS field in ur DSO
    2. Write the Start routine based on ur scenario(select the data based on ur scenario and put into internal table).
    3. wirte AFS field leval  transfer routine(Read the corresponding record based on docu num,item num) pass into RESULT.
    Regards,
    GR

  • Create a Update Routine to populate Particular records.

    Hi,
    The Lower level ODS (ZGSD_O01) has the key fields Document Number and Document Item.
    The value for GI_STS will be C for each item when it is PGI'd (Actual Goods Issue Date) and will be in other status (A or B) until it is PGI'd.(that means the order is not complete).
    The data on the ODS will be:
    Goods Issue Status Last Actual Goods Issue Date of an Order Shipping point Sales document Fiscal year variant Sales document item Tolerance Limit for Under Delivery in % Net price Quantity Confirmed as Requested Desired Delivery Quantity
    C 5/23/2006 CDC1 0000000045 Z1     50 0 0.88 0 0
    C 5/23/2006 CDC1 0000000045 Z1     60 0 0.88 0 0
    C 5/23/2006 CDC1 0000000045 Z1     70 0 0.88 0 0
    C 5/23/2006 CDC1 0000000045 Z1     80 0 0.88 0 0
    C 5/24/2006 CDC1 0000000045 Z1     90 0 0.88 0 0
    C 5/24/2006 CDC1 0000000045 Z1    100 0 0.88 0 0
    C 5/24/2006 CDC1 0000000045 Z1    110 0 0.88 0 0
    C 5/24/2006 CDC1 0000000045 Z1    120 0 0.88 0 0
    C 5/24/2006 CDC1 0000000045 Z1    130 0 0.88 0 0
    C 5/24/2006 CDC1 0000000045 Z1    140 0 0.88 0 0
    C 5/25/2006 CDC1 0000000045 Z1    150 0 0.88 0 0
    C 5/25/2006 CDC1 0000000045 Z1    160 0 0.88 0 0
    C 5/25/2006 CDC1 0000000045 Z1    170 0 0.88 0 0
    C 5/25/2006 CDC1 0000000045 Z1    180 0 0.88 0 0
    C 5/26/2006 CDC1 0000000045 Z1    190 0 0.88 0 0
    C 5/30/2006 CDC1 0000000045 Z1    200 0 0.88 0 0
    A           CDC1 0000000045 Z1    210 0 0.88 0 0
    C 5/31/2006 CDC1 0000000045 Z1    220 0 0.88 0 0
    C 6/1/2006 LV01 0000000045 Z1    230 0 65.6 0 0
    C 6/1/2006 CDC1 0000000045 Z1    240 0 65.6 0 0
    I need a logic to look in to the entire order items at lower ODS and then populate this 1 record in top ODS with the inclusion of status fields. If all the values of GI_STS are C, then a record should be populated with last item's AGI data and this. If not, a record should populated with the GI_STS either A or B.
    Can any one help me in witing a routine in the update rules of 2nd level ODS.
    here is the base code at present in the update rules.
    PROGRAM UPDATE_ROUTINE.
    $$ begin of global - insert your declaration only below this line  -
    TABLES:/BIC/AZGSD_00100.
    Data: T_ZGSD_001 like /BIC/AZGSD_00100 occurs 0 with header line.
    DATA: l_number_of_days TYPE i,
          n TYPE i.
          DATA: IN    TYPE F,
          OUT   TYPE F,
          DENOM TYPE F,
          NUMER TYPE F.
    $$ end of global - insert your declaration only before this line   -
    FORM compute_data_field
      TABLES   MONITOR STRUCTURE RSMONITOR "user defined monitoring
      USING    COMM_STRUCTURE LIKE /BIC/CS8ZGSD_001
               RECORD_NO LIKE SY-TABIX
               RECORD_ALL LIKE SY-TABIX
               SOURCE_SYSTEM LIKE RSUPDSIMULH-LOGSYS
      CHANGING RESULT LIKE /BIC/AZGSD_O0300-/BIC/ZO_STS
               RETURNCODE LIKE SY-SUBRC "Do not use!
               ABORT LIKE SY-SUBRC. "set ABORT <> 0 to cancel update
    $$ begin of routine - insert your code only below this line        -
    fill the internal table "MONITOR", to make monitor entries
    result value of the routine
    <b>IF COMM_STRUCTURE-LST_A_GD NE ' ' AND
         COMM_STRUCTURE-GI_STS EQ 'C'.
      RESULT = 'C'.
    ELSE.
    RESULT = ' '.
    ENDIF.</b>* if abort is not equal zero, the update process will be canceled
      ABORT = 0.
    $$ end of routine - insert your code only before this line         -
    please make changes in this to get records as described above.
    Regards,
    Message was edited by: Satish Muppala
    Message was edited by: Satish Muppala

    hi nagesh,
    here the data in 1st level ODS is like this.
    Goods Issue Status, Last Actual Goods Issue Date, Sales document, Fiscal year variant, Sales document item, Tolerance Limit,Quantity Confirmed
    C, 5/23/2006, CDC1, 0000000045 ,Z1,     50, 0, 0.88 ,0, 0
    C, 5/23/2006, CDC1, 0000000045, Z1,     60 ,0, 0.88, 0, 0
    C, 5/23/2006, CDC1, 0000000045, Z1,     70 0 0.88, 0, 0
    C, 5/23/2006,CDC1, 0000000045, Z1,     80, 0, 0.88, 0, 0
    C, 5/24/2006, CDC1, 0000000045, Z1,     90, 0, 0.88, 0, 0
    C, 5/24/2006, CDC1, 0000000045,Z1,    100, 0, 0.88, 0, 0
    C, 5/24/2006, CDC1, 0000000045, Z1,    110, 0, 0.88, 0, 0
    C, 5/24/2006, CDC1, 0000000045, Z1,    120, 0, 0.88, 0, 0
    C, 5/24/2006, CDC1, 0000000045, Z1,   130, 0, 0.88, 0, 0
    C, 5/24/2006, CDC1, 0000000045, Z1,    140, 0, 0.88, 0, 0
    C, 5/25/2006, CDC1, 0000000045, Z1,    150, 0 ,0.88, 0, 0
    C, 5/25/2006, CDC1, 0000000045, Z1,    160, 0, 0.88, 0, 0
    A,          ,CDC1, 0000000045, Z1,    210, 0, 0.88, 0, 0
    C, 5/31/2006, CDC1, 0000000045, Z1,    220, 0, 0.88, 0, 0
    C, 6/1/2006, LV01, 0000000045, Z1,    230, 0, 65.6, 0, 0
    C, 6/1/2006, CDC1, 0000000045, Z1,    240, 0, 65.6, 0 ,
    If suppose for a sales document no all the reocrds is Having GI_STS as 'c' then the last record with latest date should be populated.
    i.e. C, 6/1/2006, CDC1, 0000000045, Z1,    240, 0, 65.6, 0 ,
    If GI_STS is having status other than C i.e A or B. then it should populate A or B records.
    i.e A,          ,CDC1, 0000000045, Z1,    210, 0, 0.88, 0, 0
    with regards,
    sreekanth.

  • Maintaining the mapping information and writing update routine to populate

    Hi,
    Its my requriment to get the transactional data from r/3, here in the transaction data i will get the data in following format
    (for example)
    Material no.   Sales value    quantity ..
    M001              100           2
    M002              200           4
    M003              150           3
    now my requirement is to take the quantity per material number and multiply it with a factor called as SBU factor
    .. my problem is that this SBU factor is not maintained in r/3 means the mapping information of material no. with its relative SBU factor is not maintained. So i thought of two option as this mapping is fixed means it will not changed so we can maintain in bw system through 1) one time upload of flat file or
    2) maintaning a table in BW with mapping
    so users agreed to give the mapping information as follows
    Material no.    SBU factor
    M001              5
    M002              10
    M003              7
    now while uplading the transational data i need to take the SBU factor per material that is maintained through flat file or table and multiply it with quantity and store it quantity.
    for example(the result i need in cube)
    material no.   sales value    quantity(quantity * SBU)
    M001             100           2*5=10
    M002             200           4*10=40
    M003             150           3*7=21
    so i can do this at two level at transfer rules or update rules.
    I need following clarification
    1) shall i load the mapping information through flat file or maintain it in table?
    2) If i will do the transformation at update rules so wht routine (start or update) should i write to get the SBU factor per material and do transformations
    If possible send the sample routine.
    Pls reply ASAP.
    Thanks
    Saleem.

    Hi Saleem,
    Nimesh is right..Do the multiplication in the Update rules.
    If the data for this SBU factor is less and is always fixed, you can go for one time upload, else set up a RFC Call to load this data to BW from R/3 if no datasource for the same exist.
    Else you can also maintain a table in BW, in which one time upload could be done by writing an ABAP, or manually. And then you can provide authorizsation to add more values to it, so that the table can be maintained.
    And then in Update rules, use the table for look up and get the SBU Factor per material.
    Some thing like
    Select * from the <ODS table or Table name> into <internal table>
    Loop at Data_Package.
    Read table <internal table> for all values in Data_Package where internal table-Material = Data_package-MAterial.
    If sy-subrc = 0.
    Sales Value = Sales Value * internal table-SBU Factor.
    ENDIF.
    MODIFY DATA_PACKAGE.
    ENDLOOP.
    You might need to make more changes to this code as required.
    Assign points if useful
    Regards
    Rohit

Maybe you are looking for

  • JQuery/Javascript not working on Firefox and Chrome

    Hi guys, I've had this Jquery/Javascript on my page for a long time. This has stopped working. If the user clicks on buttons on the Apex page, nothing happens. It works on IE but doesn't work on Firefox and Chrome. It used to work fine. Is there anyt

  • Using iWeb with a hosting service besides .mac?

    Hello, I have not yet upgraded to iLife 08, but am deciding whether it is worth it. My question is, is it possible to host your iWeb website on something besides a .mac account (I do not have one). Or is it necessary that you pay the $99 a year to pu

  • Problem in switching JCOs

    Hi, I have a very peculiar situation out here :(. I have a single webndynpro application and need it to connect to multiple backends. The DC structure is as follows: 1) DC_UTILS - this DC contains components that actually execute the model objects. I

  • Query regarding document type

    This is a basic part of FI The Document flow in SAP-FI is categorized by the document types attached to them. All this document types differentiates the document flow, i.e. from where the accounting document was generated form SD, MM, FI etc. What SA

  • How do I move files onto a G4 with OSX 10.3.9?

    Brethren, I just gave my G4 Quicksilver to my fiancee and she is having trouble moving her laptop files onto it. She has a bunch of MP3's (songs you'd puke if you had to listen to) and jpegs (billions of them) but no streamlined way of moving the dat