Problem with Leading Zeros

Hi Experts,
In the start routine, I  am trying to compare  two object 0PLANT and ZSTORE which  contains the same values. But the problem is 0PLANT is of length 4 and ZSTORE is of length 8. As a result,for example,  the value 2  in  0PLANT is stored as '0002' and as ' 00000002'  in ZSTORE.
  I have written the code as following, which is not working due to the leading ZEROES. Please note that Both objects don't have ALPHA conversion as part of the info Object Definition.
*Select PLANT /BIC/CBRCH_GRP from /BI0/PPLANT into table I_PLNT
where PLANT = DATA_PACKAGE-/BIC/ZSTORE.*
Though I knew that there is a FM CONVERSION_EXIT_ALPHA_OUTPUT, I am not sure whether we can use that FM for procesisng bulk amount of data.
Request you all to propose a solution for the same.
Thanks in advance,
Babu Vasamsetti.

Hi Babu ,
Please use the code below.
You can modify it according to your requirements :
TYPES: BEGIN OF TY_ZTORE,
        ZTORE TYPE /BIC/OIZTORE
        PLANT TYPE /BI0/OIPLANT,
       END OF TY_ZTORE.
DATA:       LT_ZTORE TYPE STANDARD TABLE OF TY_ZTORE,
      LS_ZTORE TYPE TY_ZTORE.
SELECT /BIC/ZSTORE FROM
/BIC/PZSTORE INTO TABLE LT_ZTORE
FOR ALL ENTRIES IN DATA_PACKAGE.
SORT LT_PLANT BY /bic/ZTORE.
DELETE ADJACENT DUPLICATES FROM LT_DATAPACKAGE COMPARING /BIC/ZSTORE.
LOOP AT LT_ZTORE
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
    EXPORTING
      INPUT         = LT_ZTORE-/BIC/ZSTORE
   IMPORTING
     OUTPUT        = LT_ZTORE-PLANT.
ENDLOOP.
Select PLANT /BIC/CBRCH_GRP from /BI0/PPLANT into table I_PLNT
where PLANT = LT_STORE-PLANT.
-Vikram

Similar Messages

  • SapScript problem with leading zeros

    Hi,
    I print field LTAP-NLENR.
    But when i use &LTAP-NLENR& leading zeros are cut.
    I need to display it with leading zeros. (ex. 0000000000010000000001)
    Please help.
    Regards,
    Greg.

    &LTAP-NLENR(K)& works fine for me with your requirment.
    I have defined a L_VAR like this:
    data: L_VAR type LTAP-NLENR.
    l_var = '0000000000010000000001'.
    In my script I use like this:
    P1   &L_VAR(K)&
    SO, try to pass that value to some other variable and see what happens.
    Regards,
    Naimesh Patel

  • Re: Material number with leading zeros (40 char long)

    Hello Experts,
    I am working on SAP ME 6.1.4.15.
    I am having a problem with the material number appearing in production order / planned order request document in MEINT and failing there since the material it is looking for is with leading zeros (for example 1291 appearing as 0000000000000000000000000000000000001291) - a total of 40 char long.
    But this material exists in ME as 1291 only. Can any one throw any light on this as to what could be the reason and how to solve it?
    Thanks
    Srinivas

    Dear Srinivas,
    SAP Note 1799009 - 'Presence of leading zeros is inconsistent over IDOC thus SAP MEINT cannot handle all inbound IDOC consistently' should help to resolve the problem.
    Regards,
    Alex.

  • EBS check number with leading zeros

    When we upload EBS, we are getting the check number in the record 16 (reference field). But unlike the check number posted in SAP, the check number in the BAI file has 2 leading zeros. Now since check number is coming in record 16, instead of record 88 we are not able to solve this problem through String configuration.
    So, we thought of following solutions(Options):
    1.    Modify the check lot numbers to have two leading zeros plus associated changes like the form and so on.
    2.    Modify the check number in the incoming file u2013 strip the check number with two leading zeros with the use of customer enhancement. (After upload and before posting)
    Can we solve the problem of leading zeros (before the check number) through any configuration steps instead of changing the SAP script form for check(Check lot) or going for customer enhancement.
    Thanks
    Ron

    You are correct, since the check numbers are coming through only in the 16 records and not in the 88 records, you cannot use a search string to resolve the issue with leading zeros.  Also, I do not know of any other configuration that can be used to reformat the reference values in the 16 records.
    The 2 solutions you have listed are both valid options.  Although with the first option (changing the check lots), you would need to make sure the business users approved of changing the check lots before going forward with that option.  And you would still have to manually clear checks that had been issued prior to the check lot change.
    At my company, we went with the second option - using ABAP code to update the check numbers from the file to match those in SAP (we actually had to add leading zeros to the check numbers).  In our case, we had already created a pre-processor program for other re-formatting of the file that was needed prior to loading it into SAP - so we added the check number logic to that.
    However, if you do not have a pre-processor program, I know there is a user exit available for EBS - exit EXIT_RFEBBU10_001, include ZXF01U01.  I have heard of others using this exit to update the check numbers from 16 records.  The exit is called during the FF.5 processing.
    Regards,
    Shannon

  • Materials with leading zeros - consequences of changes

    Hello,
    In Trx OMSL is defined that materials will be shown with leading zeros (checkbox marked).
    My client is already using logistics functions involving materials and wants to change this material representation with leading zeros to material without leading zeros (Lexicografic).
    the config setting appears quit easy but Im not sure what the effects will be - if there any!?
    Anyone has done this kind of change and what were the consecuences?
    Thanks for any answer.
    Aart

    Thanks Guys,
    Ill Try to focus my question.
    In OMSL my customer has not marked the checkbox: Lexicographic
    in OMSL my customer has marked the checkbox: Leading zeros
    my customer uses matererials with internal and external number asignment.
    Material with internal number asignment behave like this
    MM03: 000000000050000010  (and the material number is show like this in ME23N, MIRO etc.)
    MARA: 000000000050000010
    OMCV-CONVERSION_EXIT_MATN1_INPUT :  
    50000010  -> 000000000050000010
    MAterial with external number asignment behave like this
    MM03:    5101377600TF
    MARA:   5101377600TF
    OMCV-CONVERSION_EXIT_MATN1_INPUT :  
    5101377600TF  -> 5101377600TF
    The behaviour of the leading zeros is especialy a problem in trx like ME23N and MIRO.
    My question is:
    If I change in OMSL and unmark the checkbox "leading zeros" , what consecuences will this have for the materials with external number asignment - if there are any?
    Can I try this out in DEV and after this reset the flag "leading zeros"?
    Thanks for any answers.
    Aart

  • Sequence with leading zeros

    Hi,
    I have a column SRL_NUM with datatype varchar2(4 char).I have 3000 records in this table and want to make SRL_NUM like 0001,0002,0003 etc.It should increment but entire 4 characters should be filled.How do i do this?
    Thanks.

    user10698496 wrote:
    I have a column SRL_NUM with datatype varchar2(4 char).I have 3000 records in this table and want to make SRL_NUM like 0001,0002,0003 etc.It should increment but entire 4 characters should be filled.How do i do this?Why is the sequence a varchar2 and not a number?
    IMO it makes more sense to use a native number data type as that is what a sequence generator outputs - and then render that as a text string with leading zero as "+how it looks like+" is a presentation layer issue.
    I would not use a numeric sequence generator to generate unique strings as surrogate key values. There are inherent problems with mixing data types like that.

  • Wired problem with LEAD Analytical function

    I am having wired problem with LEAD Analytical function. It works fine as a standalone query
    but when used in sub-query it is not behaving as expected (explained below). I unable to troubleshoot
    the issue. Please help me.
    Detail explanation and the data follows:
    ========================= Table & Test Data =======================================
    CREATE TABLE "TESTSCHED"
    (     "SEQ" NUMBER NOT NULL ENABLE,
         "EMPL_ID" NUMBER NOT NULL ENABLE,
         "SCHED_DT" DATE NOT NULL ENABLE,
         "START_DT_TM" DATE NOT NULL ENABLE,
         "END_DT_TM" DATE NOT NULL ENABLE,
         "REC_STAT" CHAR(1) NOT NULL ENABLE,
         CONSTRAINT "TESTSCHED_PK" PRIMARY KEY ("SEQ")     
    insert into testsched (SEQ, EMPL_ID, SCHED_DT, START_DT_TM, END_DT_TM, REC_STAT)
    values (1, 39609, to_date('03-03-2008', 'dd-mm-yyyy'), to_date('03-03-2008 07:00:00', 'dd-mm-yyyy hh24:mi:ss'), to_date('03-03-2008 11:00:00', 'dd-mm-yyyy hh24:mi:ss'), 'A');
    insert into testsched (SEQ, EMPL_ID, SCHED_DT, START_DT_TM, END_DT_TM, REC_STAT)
    values (2, 39609, to_date('03-03-2008', 'dd-mm-yyyy'), to_date('03-03-2008 11:00:00', 'dd-mm-yyyy hh24:mi:ss'), to_date('03-03-2008 11:30:00', 'dd-mm-yyyy hh24:mi:ss'), 'A');
    insert into testsched (SEQ, EMPL_ID, SCHED_DT, START_DT_TM, END_DT_TM, REC_STAT)
    values (3, 39609, to_date('03-03-2008', 'dd-mm-yyyy'), to_date('03-03-2008 07:00:00', 'dd-mm-yyyy hh24:mi:ss'), to_date('03-03-2008 11:30:00', 'dd-mm-yyyy hh24:mi:ss'), 'I');
    insert into testsched (SEQ, EMPL_ID, SCHED_DT, START_DT_TM, END_DT_TM, REC_STAT)
    values (4, 39609, to_date('03-03-2008', 'dd-mm-yyyy'), to_date('03-03-2008 07:15:00', 'dd-mm-yyyy hh24:mi:ss'), to_date('03-03-2008 11:30:00', 'dd-mm-yyyy hh24:mi:ss'), 'I');
    insert into testsched (SEQ, EMPL_ID, SCHED_DT, START_DT_TM, END_DT_TM, REC_STAT)
    values (5, 39609, to_date('03-03-2008', 'dd-mm-yyyy'), to_date('03-03-2008 07:15:00', 'dd-mm-yyyy hh24:mi:ss'), to_date('03-03-2008 11:00:00', 'dd-mm-yyyy hh24:mi:ss'), 'I');
    insert into testsched (SEQ, EMPL_ID, SCHED_DT, START_DT_TM, END_DT_TM, REC_STAT)
    values (6, 39609, to_date('03-03-2008', 'dd-mm-yyyy'), to_date('03-03-2008 07:00:00', 'dd-mm-yyyy hh24:mi:ss'), to_date('03-03-2008 11:00:00', 'dd-mm-yyyy hh24:mi:ss'), 'I');
    insert into testsched (SEQ, EMPL_ID, SCHED_DT, START_DT_TM, END_DT_TM, REC_STAT)
    values (7, 39609, to_date('03-03-2008', 'dd-mm-yyyy'), to_date('03-03-2008 07:00:00', 'dd-mm-yyyy hh24:mi:ss'), to_date('03-03-2008 11:00:00', 'dd-mm-yyyy hh24:mi:ss'), 'U');
    insert into testsched (SEQ, EMPL_ID, SCHED_DT, START_DT_TM, END_DT_TM, REC_STAT)
    values (8, 39609, to_date('03-03-2008', 'dd-mm-yyyy'), to_date('03-03-2008 07:00:00', 'dd-mm-yyyy hh24:mi:ss'), to_date('03-03-2008 11:00:00', 'dd-mm-yyyy hh24:mi:ss'), 'I');
    insert into testsched (SEQ, EMPL_ID, SCHED_DT, START_DT_TM, END_DT_TM, REC_STAT)
    values (9, 118327, to_date('03-03-2008', 'dd-mm-yyyy'), to_date('03-03-2008 17:30:00', 'dd-mm-yyyy hh24:mi:ss'), to_date('03-03-2008 22:00:00', 'dd-mm-yyyy hh24:mi:ss'), 'A');
    insert into testsched (SEQ, EMPL_ID, SCHED_DT, START_DT_TM, END_DT_TM, REC_STAT)
    values (10, 120033, to_date('03-03-2008', 'dd-mm-yyyy'), to_date('03-03-2008 19:30:00', 'dd-mm-yyyy hh24:mi:ss'), to_date('04-03-2008', 'dd-mm-yyyy'), 'A');
    insert into testsched (SEQ, EMPL_ID, SCHED_DT, START_DT_TM, END_DT_TM, REC_STAT)
    values (11, 120033, to_date('03-03-2008', 'dd-mm-yyyy'), to_date('03-03-2008 19:30:00', 'dd-mm-yyyy hh24:mi:ss'), to_date('04-03-2008', 'dd-mm-yyyy'), 'I');
    insert into testsched (SEQ, EMPL_ID, SCHED_DT, START_DT_TM, END_DT_TM, REC_STAT)
    values (12, 120033, to_date('03-03-2008', 'dd-mm-yyyy'), to_date('03-03-2008 17:30:00', 'dd-mm-yyyy hh24:mi:ss'), to_date('03-03-2008 19:30:00', 'dd-mm-yyyy hh24:mi:ss'), 'A');
    insert into testsched (SEQ, EMPL_ID, SCHED_DT, START_DT_TM, END_DT_TM, REC_STAT)
    values (13, 120033, to_date('03-03-2008', 'dd-mm-yyyy'), to_date('03-03-2008 17:30:00', 'dd-mm-yyyy hh24:mi:ss'), to_date('03-03-2008 19:30:00', 'dd-mm-yyyy hh24:mi:ss'), 'U');
    insert into testsched (SEQ, EMPL_ID, SCHED_DT, START_DT_TM, END_DT_TM, REC_STAT)
    values (14, 126690, to_date('03-03-2008', 'dd-mm-yyyy'), to_date('03-03-2008 18:45:00', 'dd-mm-yyyy hh24:mi:ss'), to_date('03-03-2008 21:15:00', 'dd-mm-yyyy hh24:mi:ss'), 'A');
    insert into testsched (SEQ, EMPL_ID, SCHED_DT, START_DT_TM, END_DT_TM, REC_STAT)
    values (15, 126690, to_date('03-03-2008', 'dd-mm-yyyy'), to_date('03-03-2008 12:45:00', 'dd-mm-yyyy hh24:mi:ss'), to_date('03-03-2008 16:45:00', 'dd-mm-yyyy hh24:mi:ss'), 'A');
    insert into testsched (SEQ, EMPL_ID, SCHED_DT, START_DT_TM, END_DT_TM, REC_STAT)
    values (16, 126690, to_date('03-03-2008', 'dd-mm-yyyy'), to_date('03-03-2008 12:45:00', 'dd-mm-yyyy hh24:mi:ss'), to_date('03-03-2008 21:15:00', 'dd-mm-yyyy hh24:mi:ss'), 'I');
    insert into testsched (SEQ, EMPL_ID, SCHED_DT, START_DT_TM, END_DT_TM, REC_STAT)
    values (17, 126690, to_date('03-03-2008', 'dd-mm-yyyy'), to_date('03-03-2008 16:45:00', 'dd-mm-yyyy hh24:mi:ss'), to_date('03-03-2008 18:45:00', 'dd-mm-yyyy hh24:mi:ss'), 'A');
    insert into testsched (SEQ, EMPL_ID, SCHED_DT, START_DT_TM, END_DT_TM, REC_STAT)
    values (18, 126690, to_date('03-03-2008', 'dd-mm-yyyy'), to_date('03-03-2008 16:45:00', 'dd-mm-yyyy hh24:mi:ss'), to_date('03-03-2008 18:45:00', 'dd-mm-yyyy hh24:mi:ss'), 'U');
    insert into testsched (SEQ, EMPL_ID, SCHED_DT, START_DT_TM, END_DT_TM, REC_STAT)
    values (19, 169241, to_date('03-03-2008', 'dd-mm-yyyy'), to_date('03-03-2008 05:30:00', 'dd-mm-yyyy hh24:mi:ss'), to_date('03-03-2008 14:00:00', 'dd-mm-yyyy hh24:mi:ss'), 'A');
    insert into testsched (SEQ, EMPL_ID, SCHED_DT, START_DT_TM, END_DT_TM, REC_STAT)
    values (20, 169241, to_date('03-03-2008', 'dd-mm-yyyy'), to_date('03-03-2008 05:30:00', 'dd-mm-yyyy hh24:mi:ss'), to_date('03-03-2008 14:00:00', 'dd-mm-yyyy hh24:mi:ss'), 'I');
    insert into testsched (SEQ, EMPL_ID, SCHED_DT, START_DT_TM, END_DT_TM, REC_STAT)
    values (21, 169241, to_date('03-03-2008', 'dd-mm-yyyy'), to_date('03-03-2008 17:30:00', 'dd-mm-yyyy hh24:mi:ss'), to_date('03-03-2008 22:00:00', 'dd-mm-yyyy hh24:mi:ss'), 'A');
    insert into testsched (SEQ, EMPL_ID, SCHED_DT, START_DT_TM, END_DT_TM, REC_STAT)
    values (22, 169241, to_date('03-03-2008', 'dd-mm-yyyy'), to_date('03-03-2008 17:30:00', 'dd-mm-yyyy hh24:mi:ss'), to_date('03-03-2008 22:00:00', 'dd-mm-yyyy hh24:mi:ss'), 'U');
    insert into testsched (SEQ, EMPL_ID, SCHED_DT, START_DT_TM, END_DT_TM, REC_STAT)
    values (23, 200716, to_date('03-03-2008', 'dd-mm-yyyy'), to_date('03-03-2008 17:30:00', 'dd-mm-yyyy hh24:mi:ss'), to_date('03-03-2008 22:00:00', 'dd-mm-yyyy hh24:mi:ss'), 'I');
    insert into testsched (SEQ, EMPL_ID, SCHED_DT, START_DT_TM, END_DT_TM, REC_STAT)
    values (24, 200716, to_date('03-03-2008', 'dd-mm-yyyy'), to_date('03-03-2008 17:30:00', 'dd-mm-yyyy hh24:mi:ss'), to_date('03-03-2008 22:00:00', 'dd-mm-yyyy hh24:mi:ss'), 'A');
    insert into testsched (SEQ, EMPL_ID, SCHED_DT, START_DT_TM, END_DT_TM, REC_STAT)
    values (25, 200716, to_date('03-03-2008', 'dd-mm-yyyy'), to_date('03-03-2008 17:30:00', 'dd-mm-yyyy hh24:mi:ss'), to_date('03-03-2008 22:00:00', 'dd-mm-yyyy hh24:mi:ss'), 'U');
    insert into testsched (SEQ, EMPL_ID, SCHED_DT, START_DT_TM, END_DT_TM, REC_STAT)
    values (26, 252836, to_date('03-03-2008', 'dd-mm-yyyy'), to_date('03-03-2008 19:30:00', 'dd-mm-yyyy hh24:mi:ss'), to_date('03-03-2008 22:00:00', 'dd-mm-yyyy hh24:mi:ss'), 'A');
    insert into testsched (SEQ, EMPL_ID, SCHED_DT, START_DT_TM, END_DT_TM, REC_STAT)
    values (27, 252836, to_date('03-03-2008', 'dd-mm-yyyy'), to_date('03-03-2008 17:30:00', 'dd-mm-yyyy hh24:mi:ss'), to_date('03-03-2008 22:00:00', 'dd-mm-yyyy hh24:mi:ss'), 'I');
    insert into testsched (SEQ, EMPL_ID, SCHED_DT, START_DT_TM, END_DT_TM, REC_STAT)
    values (28, 252836, to_date('03-03-2008', 'dd-mm-yyyy'), to_date('03-03-2008 17:30:00', 'dd-mm-yyyy hh24:mi:ss'), to_date('03-03-2008 19:30:00', 'dd-mm-yyyy hh24:mi:ss'), 'A');
    insert into testsched (SEQ, EMPL_ID, SCHED_DT, START_DT_TM, END_DT_TM, REC_STAT)
    values (29, 252836, to_date('03-03-2008', 'dd-mm-yyyy'), to_date('03-03-2008 17:30:00', 'dd-mm-yyyy hh24:mi:ss'), to_date('03-03-2008 19:30:00', 'dd-mm-yyyy hh24:mi:ss'), 'U');
    insert into testsched (SEQ, EMPL_ID, SCHED_DT, START_DT_TM, END_DT_TM, REC_STAT)
    values (30, 260774, to_date('03-03-2008', 'dd-mm-yyyy'), to_date('03-03-2008 07:00:00', 'dd-mm-yyyy hh24:mi:ss'), to_date('03-03-2008 10:30:00', 'dd-mm-yyyy hh24:mi:ss'), 'A');
    insert into testsched (SEQ, EMPL_ID, SCHED_DT, START_DT_TM, END_DT_TM, REC_STAT)
    values (31, 260774, to_date('03-03-2008', 'dd-mm-yyyy'), to_date('03-03-2008 10:30:00', 'dd-mm-yyyy hh24:mi:ss'), to_date('03-03-2008 14:00:00', 'dd-mm-yyyy hh24:mi:ss'), 'A');
    insert into testsched (SEQ, EMPL_ID, SCHED_DT, START_DT_TM, END_DT_TM, REC_STAT)
    values (32, 260774, to_date('03-03-2008', 'dd-mm-yyyy'), to_date('03-03-2008 05:30:00', 'dd-mm-yyyy hh24:mi:ss'), to_date('03-03-2008 07:00:00', 'dd-mm-yyyy hh24:mi:ss'), 'A');
    insert into testsched (SEQ, EMPL_ID, SCHED_DT, START_DT_TM, END_DT_TM, REC_STAT)
    values (33, 260774, to_date('03-03-2008', 'dd-mm-yyyy'), to_date('03-03-2008 07:15:00', 'dd-mm-yyyy hh24:mi:ss'), to_date('03-03-2008 10:35:00', 'dd-mm-yyyy hh24:mi:ss'), 'I');
    insert into testsched (SEQ, EMPL_ID, SCHED_DT, START_DT_TM, END_DT_TM, REC_STAT)
    values (34, 260774, to_date('03-03-2008', 'dd-mm-yyyy'), to_date('03-03-2008 07:15:00', 'dd-mm-yyyy hh24:mi:ss'), to_date('03-03-2008 10:35:00', 'dd-mm-yyyy hh24:mi:ss'), 'I');
    insert into testsched (SEQ, EMPL_ID, SCHED_DT, START_DT_TM, END_DT_TM, REC_STAT)
    values (35, 260774, to_date('03-03-2008', 'dd-mm-yyyy'), to_date('03-03-2008 05:30:00', 'dd-mm-yyyy hh24:mi:ss'), to_date('03-03-2008 14:00:00', 'dd-mm-yyyy hh24:mi:ss'), 'I');
    insert into testsched (SEQ, EMPL_ID, SCHED_DT, START_DT_TM, END_DT_TM, REC_STAT)
    values (36, 260774, to_date('03-03-2008', 'dd-mm-yyyy'), to_date('03-03-2008 07:00:00', 'dd-mm-yyyy hh24:mi:ss'), to_date('03-03-2008 10:30:00', 'dd-mm-yyyy hh24:mi:ss'), 'U');
    insert into testsched (SEQ, EMPL_ID, SCHED_DT, START_DT_TM, END_DT_TM, REC_STAT)
    values (37, 289039, to_date('03-03-2008', 'dd-mm-yyyy'), to_date('03-03-2008 16:30:00', 'dd-mm-yyyy hh24:mi:ss'), to_date('03-03-2008 22:15:00', 'dd-mm-yyyy hh24:mi:ss'), 'A');
    insert into testsched (SEQ, EMPL_ID, SCHED_DT, START_DT_TM, END_DT_TM, REC_STAT)
    values (38, 289039, to_date('03-03-2008', 'dd-mm-yyyy'), to_date('03-03-2008 13:45:00', 'dd-mm-yyyy hh24:mi:ss'), to_date('03-03-2008 22:15:00', 'dd-mm-yyyy hh24:mi:ss'), 'I');
    insert into testsched (SEQ, EMPL_ID, SCHED_DT, START_DT_TM, END_DT_TM, REC_STAT)
    values (39, 289039, to_date('03-03-2008', 'dd-mm-yyyy'), to_date('03-03-2008 13:45:00', 'dd-mm-yyyy hh24:mi:ss'), to_date('03-03-2008 16:30:00', 'dd-mm-yyyy hh24:mi:ss'), 'A');
    insert into testsched (SEQ, EMPL_ID, SCHED_DT, START_DT_TM, END_DT_TM, REC_STAT)
    values (40, 289039, to_date('03-03-2008', 'dd-mm-yyyy'), to_date('03-03-2008 13:45:00', 'dd-mm-yyyy hh24:mi:ss'), to_date('03-03-2008 16:30:00', 'dd-mm-yyyy hh24:mi:ss'), 'U');
    ========================= Problem Statement =======================================
    Problem Statement:
    Select all employees whose active schedule (rec_stat = 'A') start date & time falls
    between "16:30" and "17:45".
    An employee may be having multiple schedules on a day. It may be continuous or may be
    having breaks in between the schedules.
    If an employee schedule is continuous then the minimum schedule start date & time is
    considered as the start date & time of the work.
    If an employee is having breaks in the schedule, then each schedule start date & time is
    considered as start date & time.
    e.g:-1
    1     39609     2008/03/03     2008/03/03 07:00:00     2008/03/03 11:00:00     A
    2     39609     2008/03/03     2008/03/03 11:00:00     2008/03/03 11:30:00     A
    In above case, the employee schedule is continuous. The start date & time is 2008/03/03 07:00:00
    e.g:-2
    19     169241     2008/03/03     2008/03/03 05:30:00     2008/03/03 14:00:00     A
    21     169241     2008/03/03     2008/03/03 17:30:00     2008/03/03 22:00:00     A
    In above case, the employee is having a break in between. Then both records
    start date & time (i.e. 2008/03/03 05:30:00, 2008/03/03 05:30:00 ) is considered
    as start date & time.
    e.g:-3
    30     260774     2008/03/03     2008/03/03 07:00:00     2008/03/03 10:30:00     A
    31     260774     2008/03/03     2008/03/03 10:30:00     2008/03/03 14:00:00     A
    32     260774     2008/03/03     2008/03/03 05:30:00     2008/03/03 07:00:00     A
    In above case, the employee schedule is continuous. The start date & time is 2008/03/03 05:30:00
    ========================= Query to test Individual Employees =======================================
    Query-1: Test query to see the CASE and LEAD function works fine. If "CAL = 0" means that all
    schedules are continuous and the employee needs to ignored.
    SELECT fw.*,
    CASE WHEN LEAD(FW.END_DT_TM, 1)
    OVER(ORDER BY FW.START_DT_TM DESC ) IS NULL AND
    fw.start_dt_tm BETWEEN
    TO_DATE('03/03/2008 16:30:00','mm/dd/yyyy hh24:mi:ss') AND
    TO_DATE('03/03/2008 17:45:00','mm/dd/yyyy hh24:mi:ss')
    THEN Fw.seq
    WHEN LEAD(FW.END_DT_TM, 1)
    OVER(ORDER BY FW.START_DT_TM DESC) != FW.START_DT_TM AND
    fw.start_dt_tm BETWEEN
    TO_DATE('03/03/2008 16:30:00','mm/dd/yyyy hh24:mi:ss') AND
    TO_DATE('03/03/2008 17:45:00','mm/dd/yyyy hh24:mi:ss')
    THEN Fw.seq
    ELSE 0
    END AS "CAL"
    FROM TESTSCHED fw
    WHERE fw.empl_id = 289039
    and fw.rec_stat = 'A'
    Query Results
    SEQ     EMPL_ID     SCHED_DT     START_DT_TM          END_DT_TM          REC_STAT     CAL
    37     289039     2008/03/03     2008/03/03 16:30:00     2008/03/03 22:15:00     A          0
    39     289039     2008/03/03     2008/03/03 13:45:00     2008/03/03 16:30:00     A          0
    Since all "CAL" column is zero, the employee should be ignored.
    ========================= Query to be used in the application =======================================
    Query-2: Actual Query executed in the application which is not working. Query-1 is used as subquery
    here.
    SELECT
    F1.SEQ,
    F1.EMPL_ID,
    F1.SCHED_DT,
    F1.START_DT_TM,
    F1.END_DT_TM,
    F1.REC_STAT
    FROM TESTSCHED F1
    WHERE F1.SEQ IN
    (SELECT CASE
    WHEN LEAD(FW.END_DT_TM, 1)
    OVER(ORDER BY FW.START_DT_TM DESC) IS NULL AND
    FW.START_DT_TM BETWEEN
    TO_DATE('03/03/2008 16:30:00', 'mm/dd/yyyy hh24:mi:ss') AND
    TO_DATE('03/03/2008 17:45:00', 'mm/dd/yyyy hh24:mi:ss') THEN FW.SEQ
    WHEN LEAD(FW.END_DT_TM, 1)
    OVER(ORDER BY FW.START_DT_TM DESC) != FW.START_DT_TM AND
    FW.START_DT_TM BETWEEN
    TO_DATE('03/03/2008 16:30:00', 'mm/dd/yyyy hh24:mi:ss') AND
    TO_DATE('03/03/2008 17:45:00', 'mm/dd/yyyy hh24:mi:ss') THEN FW.SEQ
    ELSE 0
    END
    FROM TESTSCHED FW
    WHERE FW.EMPL_ID = F1.EMPL_ID
    AND FW.REC_STAT = 'A')
    Query-2 Results
    SEQ     EMPL_ID     SCHED_DT     START_DT_TM          END_DT_TM          REC_STAT
    9     118327     2008/03/03     2008/03/03 17:30:00     2008/03/03 22:00:00     A
    12     120033     2008/03/03     2008/03/03 17:30:00     2008/03/03 19:30:00     A
    17     126690     2008/03/03     2008/03/03 16:45:00     2008/03/03 18:45:00     A
    21     169241     2008/03/03     2008/03/03 17:30:00     2008/03/03 22:00:00     A
    24     200716     2008/03/03     2008/03/03 17:30:00     2008/03/03 22:00:00     A
    28     252836     2008/03/03     2008/03/03 17:30:00     2008/03/03 19:30:00     A
    37     289039     2008/03/03     2008/03/03 16:30:00     2008/03/03 22:15:00     A
    Problem with Query-2 Results:
    Employee IDs 126690 & 289039 should not appear in the List.
    Reason: Employee 126690: schedule start date & time is 2008/03/03 12:45:00 and falls outside
    "16:30" and "17:45"
    14     126690     2008/03/03     2008/03/03 18:45:00     2008/03/03 21:15:00     A
    17     126690     2008/03/03     2008/03/03 16:45:00     2008/03/03 18:45:00     A
    15     126690     2008/03/03     2008/03/03 12:45:00     2008/03/03 16:45:00     A
    Reason: Employee 289039: schedule start date & time is 2008/03/03 13:45:00 and falls outside
    37     289039     2008/03/03     2008/03/03 16:30:00     2008/03/03 22:15:00     A
    39     289039     2008/03/03     2008/03/03 13:45:00     2008/03/03 16:30:00     A

    Your LEAD function is order by fw.start_dt_tm, in your first sql, the where clause limited the records return to REC_STAT = A and EMPL_ID = 289039.
    In your 2nd query, there is no where clause, so to the LEAD function, the next record after seq 37 is seq 38 which has an end date of 2003-03-03 10:15 pm, not equal to the start time of record seq 37.
    Message was edited by:
    user477455

  • ABAP-based web service returns numeric values with leading zeros

    Hi SOA experts,
    I have created a web service out of an ABAP function module. Beside other values, this service returns a list of document numbers. All of these numeric values are returned by the web service with leading zeros, but we do want these values w/o leading zeros.
    Any ideas how I can tell the web service to not print any leading zeros?
    Thanks in advance for your help!
    Kind regards, Matthias
    PS: The according function module does not print any leading zeros for the numeric values

    hi,
    just a guess: I'd try to use I instead of NUMC for the document numbers.
    NUMC is no number but a character string with numeric characters only. only some display routines in SAP know that this string of numerals represents a number and omit leading zeroes.
    my 2 cents,
    anton

  • Need formula to take text from one cell, add that to a serial number with leading zeros

    I'm trying to create a spreasdheet cell that simplifies creating videotape Numbers from a job name in cell and appends a serial number with leading zeros, and that would survive an export to EXCEL.
    The result would look like
     A Column
    Job Name
    B ColumnTape #
    Formula needed for B
    ClientName-TapeType-
    ClientName-TapeType-001
    =
    ClientName-TapeType-
    ClientName-TapeType-002
    =
    I've tried using a custom cell format that had the text in front of the (Integer) drag and drop, with three integers and leading zeros.
    That worked, but requires recreating the custom cell format for each client and tape type.
    So, I've used the formula =A2& in order to play around with different things, but haven't hit on something that adjusts for increased numbers and retains the leading zeros.
    I don't mind doing a starter for the first row and then adding +1 in the formulas for the rows below.
    I've done that using the custom cell formats for the first B cell and then using =Bx+1 in the following cells.  It works, but I'm hoping to find something simpler or that can be copied and pasted in multiple rows on one paste.
    Thanks in advance.
    Suggestions much appreciated!
    Ted

    Ted,
    This expression in B will give you the pattern I believe you are looking for:
    =A&RIGHT("00"&ROW()-1, 3)
    Here's a screen shot...
    Jerry

  • Problem with Pole zero analysis using multisim

    Problem with Pole zero analysis using multisim
    When I tried to find input impedance function's pole zero of a parallel LC network using Multisim
    pole zero analysis, I get following message
    | | doAnalyses: matrix is singular
    | |
    | |
    | | pz simulation(s) aborted "
    The circuit as well as log file attached.
    How to correctly perform pole zero analysis?
    Solved!
    Go to Solution.
    Attachments:
    Parallel LC.JPG ‏8 KB
    parallel LC.txt ‏7 KB

    dear sir,
    thanks for your earlier reply to my question on pole zero analysis
    one more problem on pole zero analysis ;
    i tried to do pole zero analysis for circuit(shown in attached file where C1=1/6F(167mF) C2=5/18F(278mF) for which
    z(s)= (s^2+9)(s^2+1)
               s(s^2+4)
    for which zeros are at  +/-3j ,+/-1j
                  poles at       0 ,+/-2j          as per theory:
    But multisim gives different values (shown in attached file)
    what is the problem?
    please clarify.
    thanks & regards
    sagar vanarase
    Attachments:
    1portLC.JPG ‏219 KB

  • Download records to EXCEL file with  Leading Zero's for numbers

    Hi All,
    I am able to download the data to EXCEL file on the presentation server.
    There are few fields (Plant,SalesOrder Number ..with Leading Zero's) in the record.
    These values are downloaded with out Leading Zero's to excel( EX: 0000004122 as 4122).
    Please help me to download the data to EXCEL file with leading zero's.
    Thanks and Regards,
    KC

    >
    Krishna Chaitanya  G wrote:
    > The excel file which is to be downloaded..will be used by some other program..to upload the values to the sap.
    > It matters there....
    > KC
    HI KC,
    then no need to download the zeros,
    after uploading, loop at that uploaded internal table and use CONVERSION_EXIT_APLHA_INPUT and pass the vbeln(without zeros) to this FM, it will return the value with added zeros.
    hope this solves your query
    a small example
    Loop at itab into is.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
    EXPORTING
    INPUT = is-vbeln "(  this is without zeros)
    IMPORTING
    OUTPUT = is-vbeln. "( this is with leading zeros)
    modify itab from is.
    endloop.
    Edited by: Soumyaprakash Mishra on Oct 6, 2009 2:16 AM

  • SD Document flow with Leading zeros

    Hi All,
    We have issue with docuemnt flow, when we click document flow sales order or delivery or billing its showing leading zeros, My client  don't want any leading zeros in docuemnt flow.
    For example -
    if i click on document flow its showing - 00500005 (SO ) 008000674 -Delivery - - Billing - 0090000012,
    Can any other guide us what could be a issue with leading zeros or any config setting is missing.
    Regards
    Nishad

    dear friend,
    it depends on how do you set up the number ranges
    for example, run VN01 and look how your sales orders are numbered.
    regards,
    p.s. create a new number range without leading zeroes and test it
    but i suggest you will not change the current settings , it is 'too late' , so tell your client it is standard

  • How can I format a number with leading zeros?

    I need to convert an int to occupy exactly 3 positions in a StringBuffer... I need the space in the StringBuffer to be filled with leading zeros where appropriate. Can anyone show me how to do this correctly please ?
    At the moment I am using a pretty dumb workaround to fill the target with "000" first and then parse the int into either 1 2 or 3 positions depending on its value ... it works, but there must be a more correct way to do this ...
    Thanks in advance ...

    Have you had a look at the class java.text.DecimalFormat? It does exactly what you want... example:
    StringBuffer sb = new StringBuffer();
    DecimalFormat format = new DecimalFormat("000");
    format.format(2, sb, new FieldPosition(0));
    System.out.println(sb);
    prints out the string 002.

  • BPC 7.5 NW: Master Data with leading zeros

    In BPC 7.5 NW, is it still an issue to have Master data with leading zeros?
    In other words, is it still not advisable to have leading zeros in the Master data.
    Let me know your views.
    Thanks.

    I was also having the same issue almost in the same version.
    Other than what you mentioned, the master data was also jumbling up like 0120, 0130, 0145, were set up as 120, 145, 130....
    The workaround that we took was to put a leading alphabet, when the data comes into BPC.
    Try doing that, it will surely help.
    Hope this helps.
    Thanks.
    Anand

  • ** Please help urgently  ** Budget upload field with leading zeros

    We need to load a characteristic that has leading zeros.  For example 0000350.  When saving down to CSV, we lose the leading zeros (0000) so that only 350 is loaded into BW.  Saving the codes as 'text' in excel does not seem to help.
    We cannot therefore see the name for any of these codes when refreshing the workbook in BW.
    Could some please urgently tell us the correct method to save the file for loading into the BW infopackage, with all zeros intact ?
    Regards, Frederick

    Hi Frederick,
    Just some additional thoughts,
    assuming field A1 in Ecel contains 350 and you want to create a string with 8 digits, you could use formula '=text(A1;"00000000")' in an empty column and copy it back to column A. Then 00000350 should be provided in A1. This can be saved in a normal .csv file and be opened with a text editor (e.g. notepad) in order to check content.
    If you don't want to manipulate Excel data, transformation to a field with leading zeros can be easily be processed with a routine in transfer rules.
    Regards
    Joe

Maybe you are looking for

  • BI 7.0 parallel processing of queries in a web application

    Hi, I'm currently having problems with a web application / web template with 10 data providers (different queries). When executing the web application the 10 queries are executed sequentially. Since each query takes about 30 sec., the complete execut

  • TV tuner Card for Mac with Component input

    Hey everyone, I was hoping someone could help me find a good TV Tuner card for my MacBook. I found a few potentials, however I've yet to find one with Component input that would allow me to play my XBox 360 at a resolution of 1050p. This is the resol

  • Manhours not refelecting in CJI3 Line item report

    What user is meaning that manhours entered by employee/end users (personnel) for their daily work in the project does not reflect in CJI3 report (Actual line items display). I have posted manhours in CAT2 but these are not getting transferred in Proj

  • Xcelsius can't find Excel

    Hello All:    Tring to install Xcelsius BuildVersion=14.0.2.364. and it is keep on saying that I don't have excel. This is a new box, the first time I saw it I went ahead and installed Office 2010 which include Excel. But after that (and restarted th

  • ORA-06510 Message error in Process Modeller Designer

    HI� I'M DAVE I HAVE SOME PROBLEMS USING DESIGNER 6i. I log on to Windows Designer tools then I open Process Modeller Tool and I try to modify the previuous model process but, when I add a new process in the previous PM1 SATISFY CUSTOMER ORDER diagram