UDF reqiured for the below reqiurement

Hi ALL,
Can any one help me out by sending the javacode for the below reqirement.
My sender data is coming from database.So based on  2 fields i have to spilt the idocs at target side.
my reqirement is
1)Material number and 2)Batch
Case 1: For the same material number  if the batch is empty  spilt it into idocs
I.e   material number -
> 123
       batch               -
> empty
                                         123
                                         empty
In the above case it must be splited into 2 idocs
Case 2: For the same material number if the batch is  same then  spilt  these data into  idocs
         material number -
> 123
         batch               -
> 11
                                         123
                                         11
In the above case it must be splited into 2 idocs
Case 3: For the same material number if the batch is  different  then combine  these data into one idoc
material number -
> 123
         batch               -
> 11
                                         123
                                         12
In the above case it must be combined into 1 idoc
however if material number changes new idoc must be cretaed.
Good points will be given

Hi Raj,
Please see the xml structure.It does not come in the sorted order
<?xml version="1.0" encoding="utf-8" ?>
- <row>
  <BEGIN />
  <IDOC_ID>5c6b4851bb25583baa47b0c8ff6b8ce4</IDOC_ID>
  <TS>2010-03-30 15:04:52.781957</TS>
  <STATE>1</STATE>
  <PLANT>2401</PLANT>
  <COUNTRYCODE />
  <STGE_LOC>0100</STGE_LOC>
  <DOC_DATE>20100330</DOC_DATE>
  <MATERIAL>000000000001201501</MATERIAL>
  <BATCH />
  <SERIALNO>000000000000000000</SERIALNO>
  <ZREASON>45</ZREASON>
  <ZQUANTITY>00000000000003-</ZQUANTITY>
  <ZQUAN_UNIT>STK</ZQUAN_UNIT>
  <IDOC_ID>5c6b4851bb25583baa47b0c8ff6b8ce4</IDOC_ID>
  </row>
- <row>
  <BEGIN />
  <IDOC_ID>5c6b4851bb25583baa47b0c8ff6b8ce4</IDOC_ID>
  <TS>2010-03-30 15:04:52.781957</TS>
  <STATE>1</STATE>
  <PLANT>2401</PLANT>
  <COUNTRYCODE />
  <STGE_LOC>0100</STGE_LOC>
  <DOC_DATE>20100330</DOC_DATE>
  <MATERIAL>000000000001201501</MATERIAL>
  <BATCH />
  <SERIALNO>000000000000000000</SERIALNO>
  <ZREASON>45</ZREASON>
  <ZQUANTITY>00000000000002-</ZQUANTITY>
  <ZQUAN_UNIT>STK</ZQUAN_UNIT>
  <IDOC_ID>5c6b4851bb25583baa47b0c8ff6b8ce4</IDOC_ID>
  </row>

Similar Messages

  • How to deal with BRS for the below scenario?

    Hi,
    I would like to know the solution for the below scenario for BRS:
    I have a customer who was maintaining their accounts with Tally software for their previous Financial Year. This year they have shifted to SAP B1 2005B. They have issued few cheques for their vendors in the month of march 2008 which has been realised in the month of April 2008. As per Tally, the closing balance of their bank is 8 Lakh but as per the bank statement, their closing balance is 23 Lakhs. In SAP, the opening Balance for the bank is considered as 23 Lakhs. Now there are 15 Lakh worth cheques which were not realised for the month of March 2008.
    Example:
    abc a/c - 3Lakh
    def a/c - 5lakh
    xyz a/c - 7 lakh
    How do i reconcile for this scenario and what procedures do i follow in SAP?
    Thanks and Regards,
    Kaushal

    Hi Kamlesh,
    Thanks for your response.
    Actually, In the "Process External Bank Statement" window, i see that there are few entries which is for the previous year and which has not been reconciled. I have never worked practically on BRS and hence, i am scared to make any changes in the clients database without being confident on what i am doing. I need to reconcile for one of their Bank a/c for the month of April '08. I have the copy of the statements for the month ending 31st Mar 08 and 30th Apr 08. The closing balances are as below:
    31/03/08 - 2300000.00
    30/04/08 - 3100000.00
    Now my OB for Bank a/c for April '08 in SAP is 2300000.00 Dr.
    When i go to External Bank Reconciliation - Selection Criteria Screen (Manual Reconciliation), here are the detail that i enter:
    Last Balance: INR -7,000,000.00000 (Grayed out by the system)
    Ending Balance: INR -3,100,000.00000 (Entered by me)
    End Date: 30/04/08 (Entered by me)
    "Reconciliation Bank Statement" Screen opens up and shows the below balances in the screen:
    Cleared Book Balance: INR -7,000,000.00000
    Statement Ending Balance: INR -3,100,000.00000
    Difference: INR 3,800,000.00000
    As per the Bank statement, i have found all the transactions listed out here for the month of Apr '08 but, i also found that the open transactions for the previous month from April '08 have been lying in "Process External Bank Statement" window.
    Could you please help me solve my issue as to what needs to be done or could you also get me some links from where i can get few documents for processing External Bank Reconciliations?
    That will be of a great help for me. I need steps as to what needs to be done first and then the next so that i can arrive at the correct closing balance for the month April '08.
    Thanks in Advance....
    Regards,
    Kaushal

  • Need Help in finding the Menu Path's for the below topics

    Hi,
    Where can i get the menu paths for the below topics in SAP syste. I have searched in the system,But couldnot find the Menu Path's for the below topics.Kindly help me in finding the configuration Path for the below...
    1)Public tendering process
    2)Grants Management
    3)Tax & Revenue management
    4)Public sector accounting --> Budget formulation, preparation, execution & Monitoring.
    Thanks
    Rajitha M

    Hi,
    Check for the relevant path in IMG in Public Sector Management.  The prerequisites being configuration of Financial accounting
    sub modules.
    Best Regards,
    Sadashivan

  • ABAP Routine code for the below logic

    Hello BW Experts ,
    I need to write a complex ABAP routine in BW .
    Following is the detail explaination .
    Can anyone tell me the ABAP code for the below logic?
    It would be a greate help as I am unable to do this
    since last two days.
    WBS Elements are maintained at  IOS and  Warranty levels in R/3 side.
    The IOS WBS is a top level of WBS element and below that the Warranty WBS level.
    The IOS and Warranty WBS elements can be differentiated by means of priority field.
    When priority = i   , WBS Element is known as  IOS Level WBS Element and
    When  priority = Y the WBS element is known as Warranty WBS element.
    The Equipment Number is maintained compulsorily at IOS Level WBS elements only.
    It is not maintained at  Warranty WBS Element.
    But the Cost is maintained at Warranty WBS Elements.
    In BW I need all Warranty WBS ( priority = Y) along with their cost figures and Equipment Numbers.
    But as the Equipment Number is not maintained compulsorily at Warranty WBS level we have asked to
    Copy it from  IOS WBS ( priority = i ) and assign it to Warranty WBS level ( priority = Y ).
    So I have included the Equipment Number in the ODS and in update rules I need to write the routine for it as
    per the above logic.
    The Equipment Number is coming from Master data of  WBS Element.
    The WBS element master data we are loading in BW .
    Also the same WBS Element transaction data is coming from the transaction data data source in BW.
    Following fields / infoobjects and the table names in BW :
    1. Equipment Number : /BIC/ZEQUIPMNT  and table name /BIC/MZWBS_ELEM.
    2. WBS Element       : ZWBS_ELEM  is coming from transaction data data source as well as master data.
                                     In ODS update rules it is coming from  transaction data data source Comm_structure-ZWBS_ELEM.
                                     Also we are loading separetly the master data for ZWBS_ELEM.
                                     The  ZEQUIPMNT is an attribute of ZWBS_ELEM.
    3. Priority                :  PRIORITY     and table name /BIC/MZWBS_ELEM.
                                      The info object name for Priority is 0Priority but in master data table /BIC/MZWBS_ELEM
                                      the field name is    PRIORITY.
                                     When PRIORITY = ' i ' then    ZWBS_ELEM is at IOS Level
                                     When PRIORITY = ' y ' then  ZWBS_ELEM is at Warranty Level.
    4. ODS name :  /BIC/AZCOST00 and same is table name active data table .
    So please tell me the routine Code .
    Best Regards ,
    Amol.

    Hi Dinaker,
    Did you find any solution for this issue. I too have a similar requirement of pulling all the service orders for a specific Purchase Order in the BW report.
    Thanks,
    SAPBWI

  • Required clarification for the below code:

    Hi All,
    For one of my requiremnet, i found one solution which worked as expected.. But i was not able to understand the logic.. Can any one explain me the below
    syntax what exactly the meaning for the below code:
    Code:
    SELECT NULL
    FROM apex_application_page_ir_cond cond
    WHERE cond.application_id = v('APP_ID')
    AND cond.page_id = v('APP_PAGE_ID')
    AND cond.condition_type = 'Filter'
    AND cond.condition_enabled = 'Yes'
    AND cond.report_id = (SELECT report_id
    FROM apex_application_page_ir_rpt
    WHERE application_id = v('APP_ID')
    AND page_id = v('APP_PAGE_ID')
    AND application_user = v('APP_USER')
    AND report_type = 'SESSION'
    AND TO_CHAR (session_id) = v('SESSION')
    AND report_name IS NULL))
    For your refernec i have enclosed the link also
    URL : Re: Interactive_Report with Search Bar only
    Thanks,
    Anoo..

    Anoo,
    Two things. First, it makes things a lot easier if you put "&#123;code}" (no quotes) around your SQL when you post it:
    SELECT rowid "EDIT", attr_code,ATTR_ATCL_CODE "Atcl Code", attr_description, attr_atcl_code,
                    attr_abbreviation,
                    attr_include_short_desc "Include short desc",
                    attr_include_long_desc "Include long desc",
                    attr_attr_type "AttrType", rowid "DELETE"
               FROM t_new WHERE EXISTS (SELECT 1 FROM APEX_APPLICATION_PAGE_IR_COND WHERE APPLICATION_ID = :APP_ID AND PAGE_ID = :APP_PAGE_ID AND CONDITION_ENABLED = 'Yes'
    AND APPLICATION_USER = :APP_USER) ORDER BY attr_description;Though the spacing still needs work, it's a little easier to read.
    Second, your query's exist clause just checks for an enabled condition, without checking the condition type. Without checking, I'd guess that either APEX creates at least one internal condition, or that your IR has a default condition on it (other than a filter). Try adding the condition_type constraint to your where clause to see if that fixes it.
    Also, I noted that you don't have the extra code for getting the report_id. It shouldn't be necessary, since there's currently only support for one IR per page, but you asked what the differences are.
    -David

  • Performance for the below code

    Can any one help me in improving the performance for the below code.
    FORM RETRIEVE_DATA .
    CLEAR WA_TERRINFO.
    CLEAR WA_KNA1.
    CLEAR WA_ADRC.
    CLEAR SORT2.
    *To retrieve the territory information from ZPSDSALREP
    SELECT ZZTERRMG
           ZZSALESREP
           NAME1
           ZREP_PROFILE
           ZTEAM
         INTO TABLE GT_TERRINFO
         FROM ZPSDSALREP.
    *Preparing Corporate ID from KNA1 & ADRC and storing it in SORT2 field
    LOOP AT GT_TERRINFO INTO WA_TERRINFO.
      SELECT SINGLE * FROM KNA1 INTO WA_KNA1
                      WHERE KUNNR = WA_TERRINFO-SALESREP.
      SELECT SINGLE * FROM ADRC INTO WA_ADRC
                      WHERE ADDRNUMBER = WA_KNA1-ADRNR.
      IF NOT WA_ADRC-SORT2 IS INITIAL.
      CONCATENATE 'U' WA_ADRC-SORT2 INTO SORT2.
      MOVE SORT2 TO WA_TERRINFO-SORT2.
    MODIFY GT_TERRINFO1 FROM WA_TERRINFO.
      APPEND WA_TERRINFO TO GT_TERRINFO1.
      CLEAR WA_TERRINFO.
      ENDIF.
      CLEAR WA_KNA1.
      CLEAR WA_ADRC.
    ENDLOOP.
    ENDFORM.                    " RETRIEVE_DATA

    Hi
    The code is easy so I don't think you can do nothing, only u can try to limit the reading of KNA1:
    FORM RETRIEVE_DATA .
      CLEAR WA_TERRINFO.
      CLEAR WA_KNA1.
      CLEAR WA_ADRC.
      CLEAR SORT2.
    *To retrieve the territory information from ZPSDSALREP
      SELECT ZZTERRMG
      ZZSALESREP
      NAME1
      ZREP_PROFILE
      ZTEAM
      INTO TABLE GT_TERRINFO
      FROM ZPSDSALREP.
      SORT GT_TERRINFO BY SALESREP.
    *Preparing Corporate ID from KNA1 & ADRC and storing it in SORT2 field
      LOOP AT GT_TERRINFO INTO WA_TERRINFO.
        IF KNA1-KUNNR <> WA_KNA1-KUNNR.
          SELECT SINGLE * FROM KNA1 INTO WA_KNA1
               WHERE KUNNR = WA_TERRINFO-SALESREP.
          IF SY-SUBRC <> 0.
            CLEAR: WA_KNA1, WA_ADRC.
          ELSE.
            SELECT SINGLE * FROM ADRC INTO WA_ADRC
                                     WHERE ADDRNUMBER = WA_KNA1-ADRNR.
            IF SY-SUBRC <> 0. WA_ADRC. ENDIF.
          ENDIF.
        ENDIF.
        IF NOT WA_ADRC-SORT2 IS INITIAL.
          CONCATENATE 'U' WA_ADRC-SORT2 INTO SORT2.
          MOVE SORT2 TO WA_TERRINFO-SORT2.
    * MODIFY GT_TERRINFO1 FROM WA_TERRINFO.
          APPEND WA_TERRINFO TO GT_TERRINFO1.
          CLEAR WA_TERRINFO.
        ENDIF.
      ENDLOOP.
    ENDFORM. " RETRIEVE_DATA
    If program takes many times to upload the data from ZPSDSALREP, you can try to split in sevaral packages:
    SELECT ZZTERRMG ZZSALESREP NAME1 ZREP_PROFILE ZTEAM
      INTO TABLE GT_TERRINFO PACKAGE SIZE <...>
      FROM ZPSDSALREP.
      SORT GT_TERRINFO BY SALESREP.
    *Preparing Corporate ID from KNA1 & ADRC and storing it in SORT2 field
      LOOP AT GT_TERRINFO INTO WA_TERRINFO.
        IF KNA1-KUNNR <> WA_KNA1-KUNNR.
          SELECT SINGLE * FROM KNA1 INTO WA_KNA1
               WHERE KUNNR = WA_TERRINFO-SALESREP.
          IF SY-SUBRC <> 0.
            CLEAR: WA_KNA1, WA_ADRC.
          ELSE.
            SELECT SINGLE * FROM ADRC INTO WA_ADRC
                                     WHERE ADDRNUMBER = WA_KNA1-ADRNR.
            IF SY-SUBRC <> 0. WA_ADRC. ENDIF.
          ENDIF.
        ENDIF.
        IF NOT WA_ADRC-SORT2 IS INITIAL.
          CONCATENATE 'U' WA_ADRC-SORT2 INTO SORT2.
          MOVE SORT2 TO WA_TERRINFO-SORT2.
    * MODIFY GT_TERRINFO1 FROM WA_TERRINFO.
          APPEND WA_TERRINFO TO GT_TERRINFO1.
          CLEAR WA_TERRINFO.
        ENDIF.
      ENDLOOP.
    ENDSELECT.
    Max

  • Trying to find out the sql for the below 3 values

    HI Experts,
    I am trying to find the sql that can give me the values for the below three values. can some one Help me out getting these ?
    Free buffer waits (%)
    Local write wait (%)
    Latch: cache buffer chains (%)
    Actually these are the metrics which are available in OEM for the DB releases up to 9i. Post 9i releases , these metrics are obsoleted.
    So, trying to find the sql for these and use them as an UDM for the 10g and 11g DB's
    Thanks in Advance.
    Thanks,
    Naveen kumar.

    And is there any why to find using what sql the metrci is formed ?

  • I'm trying to download what's app chatting application and the massage given (need your secret answers for the below questions to proceed your purchase request ) but the problem is I forgot my answers :((( how can I reset the questions and the answer ????

    I'm trying to download what's app chatting application and the massage given (need your secret answers for the below questions to proceed your purchase request ) but the problem is I forgot my answers :((( how can I reset the questions and the answer ????

    Visit this site: http://support.apple.com/kb/HT5312

  • Dimensions for the below cubes.

    Hi All,
    My interview Q was :
    Could you plz provide me the Dimensions for the below Cubes:
    0SD_C03, 0SD_C05, 0SD_C01, 0PUR_C01
    How to find out the dimensions from the help files?
    Any other Dimensions except unit, time n pkg Dim ?? Are there any particular/specific Dim for each of these cubes ?
    Thanks in Adv.

    Hi,
    0sd_c03 having following dimensions by default
    Data Package, Time, Unit, Organization, SD Document Category, Customer, Material, Value Type, Version, Sales Area, Document Classification.
    install your required infocube's from BI content.
    double click on the particular infocube. you can able to see the dimensions available for that infocube's.
    hope this help you
    regards
    harikrishna N

  • Need to find a BAPI for the below requirement

    Hi All,
    Need to find a BAPI for the below requirement.
    We are assigning roles to users using SU01 T-Code and we are in the process of automating this and since we need a BAPI which can do this. Apart from assigning roles to users, SU01 T-code is doing many functionalities, but if we can get a BAPI which can perform assigning roles to users will suffice the requirement.
    Thanks in advance,
    Srilakshmi.

    Hi SreeLakshmi
    see the list of BAPIs given below.
    1065 Business Object Employee
    BAPI_JOBROLE_CLONE Create a User Role in Another System By Copying
    BAPI_BUPA_ROLES_GET SAP BP, BAPI: Determine All Roles
    BAPI_BUPA_ROLE_ADD SAP BP, BAPI: Add Role
    BAPI_BUPA_ROLE_EXISTENCE_CHECK SAP BP, BAPI: Check Existence of Role
    BAPI_BUPA_SET_ROLE SAP BP: Set Object Part / Roles
    BAPI_GET_EVENTTYPE_FOR_ROLE Determine Business Event Types Using Standard Role
    BAPI_EMPLOYEET_CHANGEPASSWORD Change employee password
    BAPI_EMPLOYEET_CHECKPASSWORD Check employee password
    BAPI_EMPLOYEET_CREATE_PW_REG Create entry for employee password
    BAPI_EMPLOYEET_DELETE_PW_REG Delete entry for employee password
    BAPI_EMPLOYEET_DEQUEUE Unlock employee
    BAPI_EMPLOYEET_ENQUEUE Lock employee
    BAPI_EMPLOYEET_GET_PW_REG Read entry for employee password
    BAPI_EMPLOYEET_INITPASSWORD Initialize employee password
    Reward if helpful
    Regards
    Lakshman

  • Which Image should we need for the below model router 2951 to support 4 Byte ASN number ?

    Hi All,
    Which Image should we need for the below model router 2951 to support 4 Byte ASN number ?
    CISCO2951/K9
    Cisco 2951 w/3 GE 4 EHWIC 3 DSP 2 SM 256MB CF 512MB DRAM IPB
    PWR-2921-51-AC
    Cisco 2921/2951 AC Power Supply
    CAB-ACSA
    AC Power Cord (South Africa) C13 BS 546 1.8m
    HWIC-BLANK
    Blank faceplate for HWIC slot on Cisco ISR
    ISR-CCP-EXP
    Cisco Config Pro Express on Router Flash
    MEM-2951-512MB-DEF
    512MB DRAM (1 512MB DIMM) for Cisco 2951 ISR (Default)
    MEM-CF-256MB
    256MB Compact Flash for Cisco 1900 2900 3900 ISR
    SM-S-BLANK
    Removable faceplate for SM slot on Cisco 290039004400 ISR
    SL-29-IPB-K9
    IP Base License  for Cisco 2901-2951
    S2951UK9-15501T
    Cisco 2951 IOS UNIVERSAL
    EHWIC-1GE-SFP-CU
    EHWIC 1 port dual mode SFP(100M/1G) or GE(10M/100M/1G)

    > Can someone suggest ?
    a forum is no realtime-communication ... ;-)
    For the ISR G1, it was supported from 12.4(24)T, so I would assume that your ISR G2 has this feature if you are running 15.x.
    EDIT: The Feature-navigator says that it's supported starting with 15.1(2)T.

  • Performance Issue in ABAP part as suggested by SE30 for the below coding

    Dear Abapers,
    The below coding was done by my seniors and having performance issue i.e in SE30 the abap part is consuming 98% of time.
    Pl. help us to solve this situation.
    With best regards,
    S. Arunachalam.
    the code is:
    REPORT ZOBJLIST LINE-SIZE 320 NO STANDARD PAGE HEADING. "280 to 320
    TABLES: MARA, MAKT, A916, KONP, MVKE, ZSAI_PARAM.
    Input parameters *****************************************************
    DATA IT_MARA LIKE MARA OCCURS 0 WITH HEADER LINE.
    DATA T_CLASS LIKE SCLASS OCCURS 0 WITH HEADER LINE.
    DATA T_CLOBJDAT LIKE CLOBJDAT OCCURS 0 WITH HEADER LINE.
    DATA FLG_COLOR TYPE C.
    DATA WRK_CLASS LIKE KLAH-CLASS.
    DATA WRK_PERCENT TYPE I. " Progress percentage
    DATA WRK_LINES LIKE SY-TABIX. " To store the no. of lines in int.table
    DATA WRK_PROGRESSTEXT(72) . " Progress indicator text
    DATA : BEGIN OF IT_MATNR OCCURS 0,
    MATNR LIKE MARA-MATNR,
    MAKTX LIKE MAKT-MAKTX,
    BISMT LIKE MARA-BISMT, "Thanikai-17.05.2002
    END OF IT_MATNR.
    DATA : BEGIN OF IT_HEADER OCCURS 0,
    MATNR LIKE MARA-MATNR,
    MAKTX LIKE MAKT-MAKTX,
    CLART LIKE SCLASS-KLART,
    CLASS LIKE SCLASS-CLASS,
    BISMT LIKE MARA-BISMT, "Thanikai-17.05.2002
    SCMNG(4) TYPE I, "Thanikai-03.10.2002
    END OF IT_HEADER.
    DATA : BEGIN OF IT_DETAILS OCCURS 0,
    MATNR LIKE MARA-MATNR,
    ZAEHL LIKE CLOBJDAT-ZAEHL,
    ATNAM LIKE CLOBJDAT-ATNAM,
    AUSP1 LIKE CLOBJDAT-AUSP1,
    END OF IT_DETAILS.
    DATA : BEGIN OF IT_DETAILS1 OCCURS 0,
    MATNR LIKE MARA-MATNR,
    ATNAM LIKE CLOBJDAT-ATNAM,
    ZAEHL LIKE CLOBJDAT-ZAEHL,
    END OF IT_DETAILS1.
    DATA: IT_DETAILS2 LIKE IT_DETAILS1 OCCURS 0 WITH HEADER LINE.
    DATA TMP_MATNR LIKE AUSP-OBJEK.
    DATA WRK_FIELD(25).
    DATA WRK_TABNAME(40). " Name of the int.table from wrk_fldname
    DATA WRK_FIELDNAME(40). " Name of the fld name from wrk_fldname
    DATA WRK_FLDNAME(40).
    DATA T_CLOBJDAT_LINES LIKE SY-TABIX.
    DATA WRK_LINES1 LIKE SY-TABIX.
    DATA WRK_FIRST_TIME.
    DATA TMP_STR.
    DATA WRK_AUSP1 LIKE CLOBJDAT-AUSP1.
    DATA: WRK_KBETR LIKE KONP-KBETR. "Thanikai-03.10.2002
    SELECTION-SCREEN BEGIN OF BLOCK B3 WITH FRAME TITLE TEXT-003.
    *PARAMETERS:
    SELECT-OPTIONS:
    P_MATKL FOR MARA-MATKL DEFAULT 'DIAL' OBLIGATORY NO INTERVALS.
    SELECT-OPTIONS : S_MATNR FOR MARA-MATNR MATCHCODE OBJECT MAT1.
    SELECTION-SCREEN END OF BLOCK B3.
    SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-002.
    PARAMETERS: P_CLASS LIKE KLAH-CLASS,
    P_KLART LIKE KLAH-KLART DEFAULT '001' OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK B2.
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    PARAMETERS : REQ RADIOBUTTON GROUP RGRP ,
    NREQ RADIOBUTTON GROUP RGRP .
    SELECTION-SCREEN END OF BLOCK B1.
    AT SELECTION-SCREEN.
    IF NOT P_CLASS IS INITIAL.
    WRK_CLASS = P_CLASS.
    ELSE.
    WRK_CLASS = SPACE.
    ENDIF.
    TOP-OF-PAGE.
    IF SY-BATCH NE 'X'.
    PERFORM PRINT_TOP.
    ENDIF.
    START-OF-SELECTION.
    SET PF-STATUS '9000'.
    SELECT * INTO TABLE IT_MARA
    FROM MARA CLIENT SPECIFIED
    WHERE MANDT = SY-MANDT
    AND MATKL IN P_MATKL
    AND MATNR IN S_MATNR.
    DESCRIBE TABLE IT_MARA LINES WRK_LINES.
    MOVE 'Selecting Material Description' TO WRK_PROGRESSTEXT.
    PERFORM SAPGUI USING WRK_PERCENT WRK_PROGRESSTEXT.
    LOOP AT IT_MARA.
    SELECT SINGLE * FROM MAKT CLIENT SPECIFIED
    WHERE MANDT = SY-MANDT
    AND MATNR = IT_MARA-MATNR
    AND SPRAS = 'E'.
    IF SY-SUBRC = 0.
    IT_MATNR-MATNR = IT_MARA-MATNR.
    IT_MATNR-MAKTX = MAKT-MAKTX.
    IT_MATNR-BISMT = IT_MARA-BISMT. "Thanikai-17.05.2002
    ENDIF.
    APPEND IT_MATNR.
    CLEAR IT_MATNR.
    ENDLOOP.
    CLEAR WRK_LINES.
    DESCRIBE TABLE IT_MATNR LINES WRK_LINES.
    MOVE 'Selecting Class / characteristics for the Material'
    TO WRK_PROGRESSTEXT.
    PERFORM SAPGUI USING WRK_PERCENT WRK_PROGRESSTEXT.
    LOOP AT IT_MATNR.
    CLEAR: TMP_MATNR, T_CLASS, T_CLOBJDAT. "Thanikai-26.08.2002
    REFRESH: T_CLASS, T_CLOBJDAT. "Thanikai-26.08.2002
    TMP_MATNR = IT_MATNR-MATNR.
    CALL FUNCTION 'CLAF_CLASSIFICATION_OF_OBJECTS'
    EXPORTING
    CLASS = WRK_CLASS
    CLASSTEXT = 'X'
    CLASSTYPE = '001'
    CLINT = ' '
    FEATURES = 'X'
    LANGUAGE = SY-LANGU
    OBJECT = TMP_MATNR
    OBJECTTABLE = 'MARA'
    KEY_DATE = SY-DATUM
    INITIAL_CHARACT = 'X'
    NO_VALUE_DESCRIPT = 'X'
    CHANGE_SERVICE_CLF = 'X'
    INHERITED_CHAR = ' '
    TABLES
    T_CLASS = T_CLASS
    T_OBJECTDATA = T_CLOBJDAT
    EXCEPTIONS
    NO_CLASSIFICATION = 1
    NO_CLASSTYPES = 2
    INVALID_CLASS_TYPE = 3
    OTHERS = 4.
    IF SY-SUBRC = 0.
    READ TABLE T_CLASS INDEX 1.
    IT_HEADER-MATNR = IT_MATNR-MATNR.
    IT_HEADER-MAKTX = IT_MATNR-MAKTX.
    IT_HEADER-BISMT = IT_MATNR-BISMT."Thanikai-17.05.2002
    IT_HEADER-CLART = T_CLASS-KLART.
    IT_HEADER-CLASS = T_CLASS-CLASS.
    PERFORM PKG_DLVY_UNIT.
    APPEND IT_HEADER.
    CLEAR: IT_HEADER.
    Code Start by Thanikai on 16.08.2002
    LOOP AT T_CLOBJDAT.
    IT_DETAILS-MATNR = IT_MATNR-MATNR.
    IT_DETAILS-ZAEHL = T_CLOBJDAT-ZAEHL.
    IT_DETAILS-ATNAM = T_CLOBJDAT-ATNAM.
    IT_DETAILS-AUSP1 = T_CLOBJDAT-AUSP1.
    APPEND IT_DETAILS.
    ENDLOOP.
    CLEAR: IT_DETAILS.
    LOOP AT T_CLOBJDAT.
    IT_DETAILS1-MATNR = IT_MATNR-MATNR.
    IT_DETAILS1-ATNAM = T_CLOBJDAT-ATNAM.
    IT_DETAILS1-ZAEHL = T_CLOBJDAT-ZAEHL.
    APPEND IT_DETAILS1.
    ENDLOOP.
    CLEAR: IT_DETAILS1.
    DESCRIBE TABLE IT_DETAILS1 LINES T_CLOBJDAT_LINES.
    IF WRK_FIRST_TIME NE 'X'.
    WRK_LINES1 = T_CLOBJDAT_LINES.
    WRK_FIRST_TIME = 'X'.
    IT_DETAILS2[] = IT_DETAILS1[].
    ELSE.
    IF T_CLOBJDAT_LINES GT WRK_LINES1.
    WRK_LINES1 = T_CLOBJDAT_LINES.
    IT_DETAILS2[] = IT_DETAILS1[].
    ENDIF.
    ENDIF.
    CLEAR: T_CLOBJDAT_LINES.
    CLEAR: IT_DETAILS1. REFRESH: IT_DETAILS1.
    ENDIF.
    Code end by Thanikai on 16.08.2002
    ENDLOOP.
    CLEAR: WRK_LINES1, WRK_FIRST_TIME.
    Print Details *********************************
    PERFORM PRINT_DETAILS.
    AT USER-COMMAND.
    GET CURSOR FIELD WRK_FIELD.
    SPLIT WRK_FIELD AT '-' INTO WRK_TABNAME WRK_FLDNAME.
    IF NOT WRK_FLDNAME IS INITIAL.
    CASE SY-UCOMM.
    WHEN 'SORA'.
    IF SY-LSIND > 0.
    SY-LSIND = SY-LSIND - 1. "To print in the same window
    ENDIF.
    PERFORM PRINT_REPORT_ASCENDING.
    WHEN 'SORD'.
    IF SY-LSIND > 0.
    SY-LSIND = SY-LSIND - 1. "To print in the same window
    ENDIF.
    PERFORM PRINT_REPORT_DESCENDING.
    ENDCASE.
    ELSE.
    MESSAGE S000(38) WITH 'Selete Material Number / Description'.
    ENDIF.
    *& Form SAPGUI
    text
    -->P_WRK_PERCENT text *
    -->P_WRK_PROGRESSTEXT text *
    FORM SAPGUI USING P_WRK_PERCENT
    P_WRK_PROGRESSTEXT.
    CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
    EXPORTING
    PERCENTAGE = WRK_PERCENT
    TEXT = WRK_PROGRESSTEXT
    EXCEPTIONS
    OTHERS = 1.
    ENDFORM. " SAPGUI
    *& Form PRINT_REPORT_ASCENDING
    text
    --> p1 text
    <-- p2 text
    FORM PRINT_REPORT_ASCENDING.
    IF WRK_TABNAME = 'IT_HEADER'.
    SORT IT_HEADER BY (WRK_FLDNAME).
    PERFORM PRINT_TOP.
    PERFORM PRINT_DETAILS.
    ENDIF.
    ENDFORM. " PRINT_REPORT_ASCENDING
    *& Form PRINT_DETAILS
    text
    --> p1 text
    <-- p2 text
    WRK_AUSP1 width chged below from (7)to(9) by Nagaraj/MKRK 24.11.05
    FORM PRINT_DETAILS.
    SORT IT_HEADER BY MATNR.
    IF SY-BATCH EQ 'X'.
    PERFORM PRINT_TOP.
    ENDIF.
    IF REQ = 'X'.
    LOOP AT IT_HEADER.
    IF FLG_COLOR = 'X'.
    FORMAT COLOR COL_NORMAL INTENSIFIED ON.
    CLEAR FLG_COLOR.
    ELSE.
    FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
    FLG_COLOR = 'X'.
    ENDIF.
    WRITE :/ SY-VLINE NO-GAP,
    (18) IT_HEADER-MATNR COLOR COL_KEY NO-GAP,
    SY-VLINE NO-GAP,
    (40) IT_HEADER-MAKTX NO-GAP,
    SY-VLINE NO-GAP,
    (18) IT_HEADER-BISMT NO-GAP, "Thanikai-17.05.2002
    SY-VLINE NO-GAP.
    Code started by Thanikai on 16.08.2002
    LOOP AT IT_DETAILS2.
    CLEAR: TMP_STR, WRK_AUSP1.
    IF IT_DETAILS2-ATNAM EQ 'CALIBRE'.
    LOOP AT IT_DETAILS WHERE MATNR = IT_HEADER-MATNR
    AND ATNAM = IT_DETAILS2-ATNAM
    AND ZAEHL = IT_DETAILS2-ZAEHL.
    TMP_STR = 'X'.
    WRK_AUSP1 = IT_DETAILS-AUSP1.
    EXIT.
    ENDLOOP.
    IF TMP_STR EQ 'X'.
    WRITE : (9)WRK_AUSP1 NO-GAP, SY-VLINE NO-GAP.
    ELSE.
    WRITE : ' ', SY-VLINE NO-GAP.
    ENDIF.
    ELSE.
    LOOP AT IT_DETAILS WHERE MATNR = IT_HEADER-MATNR
    AND ATNAM = IT_DETAILS2-ATNAM.
    TMP_STR = 'X'.
    WRK_AUSP1 = IT_DETAILS-AUSP1.
    EXIT.
    ENDLOOP.
    IF TMP_STR EQ 'X'.
    WRITE : (9)WRK_AUSP1 NO-GAP, SY-VLINE NO-GAP.
    ELSE.
    WRITE : ' ', SY-VLINE NO-GAP.
    ENDIF.
    ENDIF.
    ENDLOOP.
    WRITE : (8) IT_HEADER-SCMNG NO-GAP, SY-VLINE NO-GAP.
    IF SY-LINNO > 25.
    IF SY-BATCH EQ 'X'.
    NEW-PAGE.
    PERFORM PRINT_TOP.
    ENDIF.
    ENDIF.
    Code end by Thanikai on 16.08.2002..
    ENDLOOP.
    ELSEIF NREQ = 'X'.
    LOOP AT IT_HEADER.
    IF FLG_COLOR = 'X'.
    FORMAT COLOR COL_NORMAL INTENSIFIED ON.
    CLEAR FLG_COLOR.
    ELSE.
    FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
    FLG_COLOR = 'X'.
    ENDIF.
    WRITE :/ SY-VLINE NO-GAP,
    (18) IT_HEADER-MATNR COLOR COL_KEY NO-GAP,
    SY-VLINE NO-GAP,
    (18) IT_HEADER-BISMT NO-GAP, "Thanikai-17.05.2002
    SY-VLINE NO-GAP.
    Code started by Thanikai on 16.08.2002
    LOOP AT IT_DETAILS2.
    CLEAR: TMP_STR, WRK_AUSP1.
    IF IT_DETAILS2-ATNAM EQ 'CALIBRE'.
    LOOP AT IT_DETAILS WHERE MATNR = IT_HEADER-MATNR
    AND ATNAM = IT_DETAILS2-ATNAM
    AND ZAEHL = IT_DETAILS2-ZAEHL.
    TMP_STR = 'X'.
    WRK_AUSP1 = IT_DETAILS-AUSP1.
    EXIT.
    ENDLOOP.
    IF TMP_STR EQ 'X'.
    WRITE : (9)WRK_AUSP1 NO-GAP, SY-VLINE NO-GAP.
    ELSE.
    WRITE : ' ', SY-VLINE NO-GAP.
    ENDIF.
    ELSE.
    LOOP AT IT_DETAILS WHERE MATNR = IT_HEADER-MATNR
    AND ATNAM = IT_DETAILS2-ATNAM.
    TMP_STR = 'X'.
    WRK_AUSP1 = IT_DETAILS-AUSP1.
    EXIT.
    ENDLOOP.
    IF TMP_STR EQ 'X'.
    WRITE : (9)WRK_AUSP1 NO-GAP, SY-VLINE NO-GAP.
    ELSE.
    WRITE : ' ', SY-VLINE NO-GAP.
    ENDIF.
    ENDIF.
    ENDLOOP.
    WRITE : (8) IT_HEADER-SCMNG NO-GAP, SY-VLINE NO-GAP.
    IF SY-LINNO > 25.
    IF SY-BATCH EQ 'X'.
    NEW-PAGE.
    PERFORM PRINT_TOP.
    ENDIF.
    ENDIF.
    Code end by Thanikai on 16.08.2002
    ENDLOOP.
    ENDIF.
    ULINE.
    ENDFORM. " PRINT_DETAILS
    *& Form PRINT_REPORT_DESCENDING
    text
    --> p1 text
    <-- p2 text
    FORM PRINT_REPORT_DESCENDING.
    IF WRK_TABNAME = 'IT_HEADER'.
    SORT IT_HEADER BY (WRK_FLDNAME) DESCENDING.
    PERFORM PRINT_TOP.
    PERFORM PRINT_DETAILS.
    ENDIF.
    ENDFORM. " PRINT_REPORT_DESCENDING
    *& Form PRINT_TOP
    text
    --> p1 text
    <-- p2 text
    IT_DETAILS2-ATNAM width chged below from 7 to 9. Nagaraj/MKRK 24.11.05
    FORM PRINT_TOP.
    FORMAT COLOR COL_HEADING INTENSIFIED OFF.
    ULINE.
    IF REQ = 'X'.
    READ TABLE IT_HEADER INDEX 1.
    WRITE :/ SY-VLINE NO-GAP,(17) 'Material No' ,SY-VLINE NO-GAP.
    SET LEFT SCROLL-BOUNDARY.
    WRITE :(39) ' Material Description', SY-VLINE NO-GAP,
    (17) ' Old Matl. Number', SY-VLINE NO-GAP. "Thanikai-17.05.2002
    Comments made by Thanikai on 16.08.2002
    LOOP AT IT_DETAILS WHERE MATNR = IT_HEADER-MATNR.
    LOOP AT IT_DETAILS2.
    WRITE : (9) IT_DETAILS1-ATNAM NO-GAP,SY-VLINE NO-GAP.
    WRITE : (9) IT_DETAILS2-ATNAM NO-GAP,SY-VLINE NO-GAP.
    ENDLOOP.
    WRITE : (8) 'Pkg.Unit' NO-GAP, SY-VLINE NO-GAP.
    ELSEIF NREQ = 'X'.
    READ TABLE IT_HEADER INDEX 1.
    WRITE :/ SY-VLINE NO-GAP, (17) 'Material No' ,SY-VLINE NO-GAP,
    (17) ' Old Matl. Number', SY-VLINE NO-GAP. "Thanikai-17.05.2002
    Comments made by Thanikai on 16.08.2002
    LOOP AT IT_DETAILS WHERE MATNR = IT_HEADER-MATNR.
    LOOP AT IT_DETAILS2.
    WRITE : (9) IT_DETAILS-ATNAM NO-GAP,SY-VLINE NO-GAP.
    WRITE : (9) IT_DETAILS2-ATNAM NO-GAP,SY-VLINE NO-GAP.
    ENDLOOP.
    WRITE : (8) 'Pkg.Unit' NO-GAP, SY-VLINE NO-GAP.
    ENDIF.
    ULINE.
    FORMAT RESET.
    ENDFORM. " PRINT_TOP
    *& Form PKG_DLVY_UNIT
    text
    --> p1 text
    <-- p2 text
    FORM PKG_DLVY_UNIT.
    SELECT SINGLE KONP~KBETR INTO WRK_KBETR
    FROM ( A916 INNER JOIN KONP
    ON KONP~MANDT = SY-MANDT
    AND KONPKNUMH = A916KNUMH
    AND KONP~KOPOS = '01' ) CLIENT SPECIFIED
    WHERE A916~MANDT = SY-MANDT
    AND A916~KAPPL = 'V'
    AND A916~KSCHL = 'PR00'
    AND A916~VKORG = 'WTCH'
    AND A916~VTWEG = '01'
    AND A916~SPART = '01'
    AND A916~MATNR = IT_MATNR-MATNR
    AND A916~DATBI >= SY-DATUM
    AND A916~DATAB <= SY-DATUM.
    IF SY-SUBRC EQ 0.
    SELECT SINGLE * FROM ZSAI_PARAM CLIENT SPECIFIED
    WHERE MANDT = SY-MANDT
    AND PMFID = 'ZPKG_PRICE'
    AND PMVL1 = '01'.
    IF SY-SUBRC EQ 0.
    IF WRK_KBETR BETWEEN 1 AND ZSAI_PARAM-PMVL2.
    SELECT SINGLE * FROM MVKE CLIENT SPECIFIED
    WHERE MANDT = SY-MANDT
    AND MATNR = IT_MATNR-MATNR
    AND VKORG = 'WTCH'
    AND VTWEG = '01'.
    IF SY-SUBRC EQ 0.
    IF MVKE-SCMNG GE 1.
    IT_HEADER-SCMNG = MVKE-SCMNG.
    ELSE.
    In the absence of delivery unit for a material,
    delivery unit is considered as one.
    IT_HEADER-SCMNG = 1.
    ENDIF.
    ELSE.
    IT_HEADER-SCMNG = 1.
    ENDIF.
    ELSE.
    If the price for a material is either below 1 or above 2499, then
    the delivery unit is considered as one.
    IT_HEADER-SCMNG = 1.
    ENDIF.
    ELSE.
    IT_HEADER-SCMNG = 1.
    ENDIF.
    ELSE.
    In the absence of price for a material, delivery unit is
    considered as one.
    IT_HEADER-SCMNG = 1.
    ENDIF.
    CLEAR: WRK_KBETR.
    ENDFORM. " PKG_DLVY_UNIT

    The first point would be to change the following:
    LOOP AT IT_MARA.
    SELECT SINGLE * FROM MAKT CLIENT SPECIFIED
    WHERE MANDT = SY-MANDT
    AND MATNR = IT_MARA-MATNR
    AND SPRAS = 'E'.
    IF SY-SUBRC = 0.
    IT_MATNR-MATNR = IT_MARA-MATNR.
    IT_MATNR-MAKTX = MAKT-MAKTX.
    IT_MATNR-BISMT = IT_MARA-BISMT. "Thanikai-17.05.2002
    ENDIF.
    APPEND IT_MATNR.
    CLEAR IT_MATNR.
    ENDLOOP.
    I would sort IT_MARA by matnr then select for all entries into new table IT_matnr and only read when you are actuallygoing to use it for your final table.
    This however will not make much difference to your problem. I suggest you put more of the code into subroutines and look at the se30 output as tyo which subroutines are actually taking most of the time. Please post the results and the subroutines which take the longest.

  • Pls. JS for the below simple IF statement

    Hello,
    I am new to JavaScript, could you pls. consolidate the below 2 IF statements into only 1 summary IF statement (I mean, put the red IF statement into blue IF statement)
    my_form:Page1:SunForm1:Middle_Name_text_field ::: Change JavaScript
    I wrote the below code in the CHANGE event of a text field of "Middle_Name_text_field"
    // Hide associated check box
    // As soon as user started entering the data, make associated check box as invisible
    // or if erased the data again then make the check box visible
    if (xfa.event.newText.length > 0) {
         MiddleName_CheckBox.presence = "hidden";
    else {
    // I guess, the below red piece should come here
         MiddleName_CheckBox.presence = "visible";
    var yc  //Yellow color
    yc = " "
    yc = (this.ui.oneOfChild.border.fill.color.value);
    // If the Middle Name text field is colored with yellow, then make it again invisible, no matter wht the above IF statement yileds in
    if (yc == "255,255,191") {
         MiddleName_CheckBox.presence = "hidden";
    Thank you

    Hi,
    This should work:
    // Hide associated check box
    // As soon as user started entering the data, make associated check box as invisible
    // or if erased the data again then make the check box visible
    var yc = (this.ui.oneOfChild.border.fill.color.value);
    if (xfa.event.newText.length > 0 || yc == "255,255,191") {
         MiddleName_CheckBox.presence = "hidden";
    else {
         MiddleName_CheckBox.presence = "visible";
    The || is JavaScript for "or", so that if either condition is met the field is hidden.
    Hope that helps,
    Niall

  • JS for the below simple IF statement pls.?

    Hello,
    I am new to JavaScript, could you pls. consolidate the below 2 IF statements into only 1 summary IF statement (I mean, put the red IF statement into blue IF statement)
    my_form:Page1:SunForm1:Middle_Name_text_field ::: Change JavaScript
    I wrote the below code in the CHANGE event of a text field of "Middle_Name_text_field"
    // Hide associated check box
    // As soon as user started entering the data, make associated check box as invisible
    // or if erased the data again then make the check box visible
    if (xfa.event.newText.length > 0) {
         MiddleName_CheckBox.presence = "hidden";
    else {
    // I guess, the below red piece should come here
         MiddleName_CheckBox.presence = "visible";
    var yc  //Yellow color
    yc = " "
    yc = (this.ui.oneOfChild.border.fill.color.value);
    // If the Middle Name text field is colored with yellow, then make it again invisible, no matter wht the above IF statement yileds in
    if (yc == "255,255,191") {
         MiddleName_CheckBox.presence = "hidden";
    Thank you

    Hi,
    This should work:
    // Hide associated check box
    // As soon as user started entering the data, make associated check box as invisible
    // or if erased the data again then make the check box visible
    var yc = (this.ui.oneOfChild.border.fill.color.value);
    if (xfa.event.newText.length > 0 || yc == "255,255,191") {
         MiddleName_CheckBox.presence = "hidden";
    else {
         MiddleName_CheckBox.presence = "visible";
    The || is JavaScript for "or", so that if either condition is met the field is hidden.
    Hope that helps,
    Niall

  • Need ABAP code for the below Services requirement

    Hi,
    We have a requirement to show all the services for a particular Purchase order number.For this I built a view on 2 tables ESLL and EKPO.Now based on the below logic I need to bring the services for the Purchase order..
    1.Enter PO number,item no. and Doc category in EKPO and find the Pack no.
    2.Now take the Pack no. of EKPO and give in ESLL and find the Sub pack no.
    3.Now take this Subpack no. and Give this sub pack as Pack no. in ESLL
    4.This will be the Service entry record for that PO number.
    Can any one Please suggest me to how to write the ABAP code for the above logic.
    Thanks & Regards,
    Dinakar

    Hi Dinaker,
    Did you find any solution for this issue. I too have a similar requirement of pulling all the service orders for a specific Purchase Order in the BW report.
    Thanks,
    SAPBWI

Maybe you are looking for

  • ICould calendar week view on iMac

    Why doesn't my iCloud Calendar advance to the next week in the week view?  It use to.  It will still advance in the day or month view.

  • Help! Windows Vista not recognizing Nokia C5

    Hi,  I just purchased a New Nokia C5-00 5 days back but i am not able to synchronize it with my PC. Everytime I connect my phone with the PC using the provided CA-101D data cable, nothing pops up on the phone screen to select PC Suite or Mass Storage

  • Downloading Java

    I am trying to download java 5.0 to a Windows Vista computer and I keep getting an error message that states the file failed to create a destination file. Does anyone know what that means?

  • Flash not playing/showing when embedded in DW

    I'm getting back into doing web work after a 8 year lay off, so I may be doing something really basic wrong. However, I believed embedding my .swf file into my web page was so simple, even somebody with completely out of date knowledge could do it. I

  • Flash container issue

    I am facing a issue in Flash container. I am having a project which has main container which call different SWFs into it. Now I call this main container file into another container, and their problem starts. Many option doesn't work properly which ge