Require  help in my ABAP code

Hi All,
My design wont allow Delta loads because the transformation source is an InfoSet.  To limit the data in these loads, I require a  filter in the DTPs on fiscal year/period then only load I can load the current month and 2 prior months.  Now we are updating manually for the DTPs.   To eliminate this monthly task a dynamic filter (routine) needs should be used rather than a static filter.
So I have written as follows  But in the debugger mode am able to see the -3months to the current date but records are not filtered. Any help please
*&  Include           RSBC_SEL_ROUTINE_TPL -
program conversion_routine.---
Type pools used by conversion program---
type-pools: rsarc, rsarr, rssm.---
tables: rssdlrange.---
Global code used by conversion rules---
$$ begin of global - insert your declaration only below this line  ----
TABLES: ...---
DATA:   ...------
$$ end of global - insert your declaration only before this line   ----
    Fieldname       = F139---
    data type       = NUMC---
    length          = 000007---
form compute_F139---
  tables l_t_range structure rssdlrange---
  changing p_subrc like sy-subrc.---
      Insert source code to current selection field---
$$ begin of routine - insert your code only below this line        ----
  data: l_idx like sy-tabix.---
  read table l_t_range with key---
       fieldname = '/bic/0FISCPER' .---
  l_idx = sy-tabix.---
  DATA: w_date TYPE SY-DATUM,---
      w_date1 type sy-datum,---
      lv_idate(8) type n,---
      lv_odate(8) type n,---
      lv_date1(7) type n,---
      lv_date2(8) type n.---
  CONCATENATE SY-DATUM0(4) SY-DATUM4(2) sy-datum+6(2) into W_DATE.---
  CALL FUNCTION 'SEPA_MANDATE_ADD_MONTH_TO_DATE'---
    EXPORTING---
      MONTHS  = '-3'---
      OLDDATE = W_DATE---
    IMPORTING---
      NEWDATE = W_DATE1.---
  Concatenate W_DATE0(4) W_DATE4(2) W_DATE+6(2) into lv_Idate.---
  Concatenate W_DATE10(4) W_DATE14(2) W_DATE1+6(2) into lv_odate.---
  Concatenate '0' W_DATE4(2) '.' W_DATE0(4) into lv_date2.---
   Concatenate '0' W_DATE14(2)  W_DATE10(4) into lv_date1.---
CALL FUNCTION 'UMC_CALDAY_TO_FISCPER'---
   EXPORTING---
    I_PERIV    = 'K1'---
    I_CALDAY   = lv_Idate---
   IMPORTING---
     OUTPUT = lv_date1.---
CALL FUNCTION 'UMC_CALDAY_TO_FISCPER'---
   EXPORTING---
    I_PERIV    = 'K1'---
    I_CALDAY   = lv_odate---
   IMPORTING---
     OUTPUT = lv_date2.---
*l_t_range-iobjnm = '0FISCPER'.---
l_t_range-fieldname = '/bic/0FISCPER'.---
l_t_range-sign = 'I'.---
l_t_range-option = 'GE'.---
l_t_range-low = lv_date1.---
*l_t_range-high = lv_date2.---
  if l_idx <> 0.---
    modify l_t_range index l_idx.---
  else.---
    append l_t_range.---
  endif.---
  p_subrc = 0.---
$$ end of routine - insert your code only before this line         ----
endform.---
-Ashwin
Edited by: ashwin kumar on Jun 16, 2010 10:04 AM

1. In the future, please use a meaningful subject line, like "loop not performing last iteration." Just saying "Help in my java code" is useless. We know you need help with your Java code, else you wouldn't be posting here.
2. Repost your code without those annoying superfluous asterisks, and with proper indentation in the section that they are currently polluting. It's too hard to read as-is.

Similar Messages

  • Need Help With Simple ABAP Code

    Hello,
    I'm loading data from a DSO (ZDTBMAJ) to an Infocube (ZCBRAD06). I need help with ABAP code to some of the logic in Start Routine. DSO has 2 fields: ZOCTDLINX & ZOCBRDMAJ.
    1. Need to populate ZOCPRODCD & ZOCREFNUM fields in Infocube:
        Logic:-
        Lookup /BI0/PMATERIAL, if /BIC/ZOCBRDMAJ = /BIC/OIZOCBRDMAJ
        then /BIC/ZOCPRODCD = ZOCPRODCD in Infocube
               /BIC/ZOCREFNUM = ZOCREFNUM in Infocube         
    2. Need to populate 0G_CWWTER field in Infocube:
        Logic:
        Lookup /BIC/PZOCTDLINX, if /BIC/ZOCTDLINX = BIC/OIZOCTDLINX
        then G_CWWTER = 0G_CWWTER in Infocube.
    I would need to read single row at a time.
    Thanks!

    I resolved it.

  • Please help me with ABAP code

    Hi Gurus,
    Please help me with the code.
    Algorithm: This is for master data extraction. I need to append some records to I_T_DATA before the loop on I_T_DATA begins.
    ZTAB is a custom defined table with key KEY. STAB is standard table with key KEY.
    1. Create an internal table I_T_STAB similar to STAB.
    2. Loop at I_T_DATA
        Read record from ZTAB where KEY = I_T_DATA-KEY and { field1 <> I_T_DATA-field1 or field2 <> I_T_DATA-field2 <> field3 <> I_T_DATA-field3}
    If success
         Delete record from I_T_DATA.
    Else
         Continue loop.
    Copy all records of STAB to I_T_STAB.
    3. Delete records in I_T_STAB where I_T_STAB-KEY = ZTAB-KEY.
    Now
    4. Delete all records in I_T_DATA where I_T_DATA-KEY = I_T_STAB-KEY.
    Now,
    5. Append all the remaining records from step 3 in I_T_STAB to I_T_DATA.
    Please help me with the code upto this part.
    Now the actual code in exit starts.
    Loop at I_T_DATA
    Thanks,
    Regards,
    aarthi
    [email protected]

    You might get a quick answer if you were to post in the ABAP forum. 
    Moderator, please move to ABAP forum.  Thanks.
    Regards,
    Rich Heilman

  • Help with basic ABAP code (merge internal tables, sort of...)

    Hello,
    Can someone please help write some basic code for a Basis guy with limited ABAP knowledge?
    Should be some easy points for an experienced ABAPer!
    I have identicaly structured internal tables I_A and I_B and I_C which have already been filled by function models I called.
    How will I code the following?:
    I want to read all the data of I_A into a new internal table I_MASTER (structured the same as I_A,I_B and I_C).
    Then I want to read I_B and:
    1)Update I_MASTER with NEW records
    2)Update existing records if the value of field MYFIELD in I_B is smaller than the value of MYFIELD in I_MASTER.
    Then I want to read I_C and:
    1)Update I_MASTER with NEW records
    2)Update existing records if the value of field MYFIELD in I_C is smaller than the value of MYFIELD in I_MASTER.
    Let me know if I can provide anymore information.
    Thanks in advance for you help!
    Adriaan
    Message was edited by: Adriaan
    Message was edited by: Adriaan

    Hi Adriaan ,
    I want to read all the data of I_A into a new internal table I_MASTER (structured the same as I_A,I_B and I_C).
    <b>i_master[] = i_a[] .</b>
    loop at i_b .
    read table i_master with key myfiled < i_b-myfield .
    if sy-subrc = 0 .
    append i_master from i_b .
    endif.
    endloop.
    loop at i_c .
    read table i_master with key myfiled < i_c-myfield .
    if sy-subrc = 0 .
    append i_master from i_c .
    endif.
    endloop.
    Let me know if this helped .
    Regards,
    Varun .
    Message was edited by: varun sonu

  • Pulling the condition records - help in the ABAP code -urgent!!!!!

    hi folks,
    I need some urgent help here..
    I have discussed this portion before in the forum  but there are some changes and I need some help here.
    The code goes like this....
    select knumv kschl kbetr kwert
      from konv into table cdata
         for all entries in bodyitab21
        where konv~knumv = bodyitab21-knumv
                     and konv~kwert > 0.
    I am successfully pulling the data into cdata here..
    I need to check for various condition types that are around 100. I need to split them into two types because some condition types containe just pricing values while some others have values in % (but the value not stored in that format) To do the extra coding I have use two differetn case statements and that's what i have done here.
    <b>My probelm is I will have to check for each condition type, if the 'kwert' field has some value in it pull the data  and there is a condition text associcated to it in the table 'T685T' that needs to be pulled into the itab.
    This process has to be done for every condition type.</b>Given this scenario how can i do it?
        loop at cdata  into wac.
        case wac-kschl.
             when 'ZRAT' OR 'ZAGR'  OR 'ZRCR' OR 'Y098' OR 'Y007' OR 'ZREW' OR 'Y106' OR 'ZTSR' OR 'Y127' OR 'Y125' OR 'Y126' OR 'Y124' OR 'Y157' OR 'Y092' OR 'Y085' OR 'Y090' OR 'ZMZD' OR 'Y215' OR 'Y214' OR 'Y111' OR 'ZC$D' OR 'ZAUD' OR 'ZTHX' OR 'ZCOL'
    OR 'ZCFE' OR ZSPA' OR 'ZBOX' OR 'ZCOR' OR 'Y130' OR 'ZBOR'
    OR 'Y108' OR 'ZFPP' OR 'Y204' OR 'Y200' OR 'Y202' OR 'Y201' OR 'Y203' OR 'Y002' OR 'ZSCR' OR 'Y128' OR 'Y100' OR 'ZABS' OR 'ZSMG' OR 'ZFRE' OR 'ZREC' OR 'ZCOM' OR 'ZPMG' OR 'BEMG' OR 'ZDTI' OR'ZBET'.
    <b>***** the first set of these condition types have just values</b>     if wac-kbetr = ' ' AND wac-kwert = ' '.
                   continue.
                 else.
                  p = wac-kbetr.
                  i = p.
                  c = i.
                  MOVE c to w_accitab-zrate.
                     MOVE wac-kbetr to w_accitab-zrate.
                  MOVE wac-kwert to w_accitab-zsubtotal.
                endif.
        when 'ZSED' OR 'ZRFQ' OR 'ZIMP' OR 'ZERR'
         OR 'ZECD' 'ZAC1' OR 'ZAC%' OR 'ZAC2' OR 'ZSED' OR 'ZRFQ' OR 'ZIMP' OR 'ZERR' OR 'ZECD' 'ZQUD' OR 'ZEMP' OR 'Y101' OR 'Y012' OR 'ZCHU' OR 'Y054' OR 'Y065' OR 'Y066' OR 'Y067' OR 'Y068' OR 'Y069' OR 'Y096'
    OR 'Y103' OR 'Y010' OR 'Y070' OR 'Y071' OR
    'Y072' OR 'Y073' OR 'Y074' OR 'Y075' OR 'Y076'
    OR 'Y077' OR 'Y078' OR 'Y079' OR 'Y156' OR OR 'Y148'
    OR 'Y102' OR 'Y205' OR 'Y206' OR 'Y207' OR 'Y208' OR
    'Y209' OR 'Y213' OR 'Y210' OR 'Y211' OR 'Y212' OR 'Z%DS'
    OR 'Z%DO' OR 'Y113' OR 'Y151' OR 'Y152' OR 'Y153' OR
    'Y154' OR 'Y155' OR 'Y147' OR'Z%PB' OR 'Y142' OR 'Y131'
    OR 'Y141' OR 'Y149' OR 'ZDEO' OR 'Z%DR' OR 'Y115' OR
    'Y116' OR 'Y095' OR 'Y084' OR 'ZSA$' OR 'ZSA%' OR
    'ZPA$' OR 'ZPA%'.
    the second set of these condition types have just values that has to be converted into %.
               if wac-kbetr = ' ' AND wac-kwert = ' '.
                clear w_accitab-zrate.
                continue.
              else.
                p = wac-kbetr.
                p = p / 10.
                if p < 1.
                  rate+0(1) = '-'.
                endif.
                if i = 0.
                  clear w_accitab-zrate.
                 else.
                i = p.
                c = i.
                shift c right deleting trailing '-'.
                concatenate rate c '%' into rate.
                condense rate no-gaps.
                     MOVE wac-kbetr to w_accitab-zrate.
                MOVE rate to w_accitab-zrate.
                clear rate.
                MOVE wac-kwert to w_accitab-zsubtotal.
              endif.
            endif.
    Thanks alot in advance.
    Santhosh

    Maybe this will help you,  otherwise I'm missing something.
    [code]
    data: begin of wac,
          kschl type t685t-kschl,
          vtext type t685t-vtext,
          end of wac.
    case wac-kschl.
    when 'ZRAT' or 'ZAGR' or 'ZRCR' or 'Y098' or 'Y007' or 'ZREW' or 'Y106'
    or 'ZTSR' or 'Y127' or 'Y125' or 'Y126' or 'Y124' or 'Y157' or 'Y092' or
      'Y085' or 'Y090' or 'ZMZD' or 'Y215' or 'Y214' or 'Y111' or 'ZC$D' or
         'ZAUD' or 'ZTHX' or 'ZCOL' or 'ZCFE' or 'ZSPA' or 'ZBOX' or 'ZCOR'
    or 'Y130' or 'ZBOR' or 'Y108' or 'ZFPP' or 'Y204' or 'Y200' or 'Y202' or
      'Y201' or 'Y203' or 'Y002' or 'ZSCR' or 'Y128' or 'Y100' or 'ZABS' or
         'ZSMG' or 'ZFRE' or 'ZREC' or 'ZCOM' or 'ZPMG' or 'BEMG' or 'ZDTI'
            or'ZBET'.
    Some code
      when 'ZSED' or 'ZRFQ' or 'ZIMP' or 'ZERR'
    or 'ZECD' or 'ZAC1' or 'ZAC%' or 'ZAC2' or 'ZSED' or 'ZRFQ' or 'ZIMP' or
      'ZERR' or 'ZECD' or 'ZQUD' or 'ZEMP' or 'Y101' or 'Y012' or 'ZCHU' or
      'Y054' or 'Y065' or 'Y066' or 'Y067' or 'Y068' or 'Y069' or 'Y096'
      or 'Y103' or 'Y010' or 'Y070' or 'Y071' or
      'Y072' or 'Y073' or 'Y074' or 'Y075' or 'Y076'
      or 'Y077' or 'Y078' or 'Y079' or 'Y156' or 'Y148'
      or 'Y102' or 'Y205' or 'Y206' or 'Y207' or 'Y208' or
      'Y209' or 'Y213' or 'Y210' or 'Y211' or 'Y212' or 'Z%DS'
      or 'Z%DO' or 'Y113' or 'Y151' or 'Y152' or 'Y153' or
      'Y154' or 'Y155' or 'Y147' or'Z%PB' or 'Y142' or 'Y131'
      or 'Y141' or 'Y149' or 'ZDEO' or 'Z%DR' or 'Y115' or
      'Y116' or 'Y095' or 'Y084' or 'ZSA$' or 'ZSA%' or
      'ZPA$' or 'ZPA%'.
    Some code
    endcase.
    select single vtext into wac-vtext from t685t
                  where spras = sy-langu
                    and kschl = wac-kschl.
    write:/ wac-kschl, wac-vtext.
    [/code]
    Regards,
    Rich Heilman

  • Need help in writing ABAP Code

    Hi All,
    I have a scenario to write a code for below requirement to fetch a latest sales document based on Last Date of Change and Last Time Change and I have written below code in the transfer rule..
    SORT datapak BY Sales Doc
      Last Date of Change Last Time Change descending.
    DELETE ADJACENT DUPLICATES FROM DATAPAK
    COMPARING Sales Doc
    The above code works as per below details
    Data is coming from source in FULL mode
    Data in Source: Input
    Sales Doc       Last Date of Change    Last Time Change    Order Reason
    201                01/03/2014                   04:10:00                        A
    201                 01/03/2014                   05:12:00                        B
    Output: Data in DSO(after moving from transfer rule)
    201                  01/03/2014                  05:12:00                        B             ------------------This is correct(record based on latest date of modification and time)
    Data in source
    Sales Doc       Last Date of Change    Last Time Change    Order Reason
    201                01/03/2014                   04:10:00                        A
    201                 02/04/2014                   05:12:00                        B
    Data in output
    201                01/03/2014                   04:10:00                        A 
    201                 02/04/2014                  05:12:00                        B  -------------------------In this case code is not working when Last date of Modification is different, the DSO fetches both the records while it should fetch only record with latest Date of Modification and Time....
    Could you pls advice if the code is correct or any changes to be made to the code..

    Hi Antony,
    Here the problem is of SORT statement when the Time has been introduced as the sorting factor.
    Please apply below additional code and it will do the job for you.
    *Additional Code
    DATA: ls_datapak LIKE LINE OF datapak.
    DATA: ls_datapak1 LIKE LINE OF datapak.
    * First sort the datapack with only last change date
    SORT datapak BY vbeln aedat DESCENDING.
    * remove all the old dates first and keep only the latest change date in DATAPAK
    READ TABLE datapak INTO ls_datapak1 INDEX 1.
    LOOP AT datapak INTO ls_vbak.
      IF ls_datapak-aedat LT ls_datapak1-aedat.
        DELETE datapak INDEX sy-tabix.
      ENDIF.
    ENDLOOP.
    * below is your code
    SORT datapak BY vbeln aedat lastchangetime DESCENDING.
    DELETE ADJACENT DUPLICATES FROM datapak COMPARING vbeln.
    Please let me know if you face any issue with this code.
    Thanks
    Amit

  • Need help in framing ABAP code

    Hi,
    Can someone help me frame code for the below logic
    In start routine, if records that have a common record for PO 0OI_EBELN in ITROMML ODS and 0AC_DOC_NO on ITROFIL ODS , then the entire PO record details will be deleted from ITROMML ODS . Therefore  0AC_DOC_NO details from ITROFIL ODS will be filled in ITROCMH ODS and ITROCMD ODS.
    Logic is like : Using the Material Document Number ITRMATDOC, line item ITRMTDCLI and fiscal year 0FISCYEAR as key - open POs (0OI_EBELN) from ITROMML ODS are checked with invoices 0AC_DOC_NO in ITROFIL ODS and if the respective keys match, then the entire record is deleted from ITROMML ODS and only invoiced records are brought into the second level ODS ITROCMH and ITROCMD
    Here,
    ITROMML and ITROFIL are first level ODS
    ITROCMH and ITROCMD are second level ODS
    I need to write the start routine in between these two levels in BI.7

    any suggestions please?

  • Help in the abap code

    hi folks,
    I am checking for various condition types through this code for various orders. Each order has a different set of condition records.
    My requirement: when a order has a condition record for the condition type 'ZAGR' (AGREED PRICE) it should execute that block and ignore all the other condition types for that record and directly go to 'ZBET'to fetch the final amount
    How to incorporate that piece code here?
    The code goes like this...
    loop at cdata  into zcdata where
            knumv = bodyitabtotal-knumv.
    case zcdata-kschl.
             when 'ZRAT' OR 'ZFLE' OR 'ZRCR' OR 'ZFIX'.
           when 'ZAGR'.
            when 'ZONT'.
                concatenate zzkeyword  zpofield
                     into CTEXT3
                   separated by space
              MOVE zcdata-kbetr to w_accitab-zrate.
              MOVE zcdata-kwert to w_accitab-zsubtotal.
          when 'ZSMG'.
            when 'ZBET'.
             if zcdata-kbetr = ' ' AND zcdata-kwert = ' '.
                  MOVE '  ' TO w_accitab-zamount.
              ELSE.
                 MOVE zcdata-kwert to w_accitab-zamount.
              ENDIF.
            when  others.
              continue.
          endcase.
    Thanks
    Santhosh

    Rich,
    I need the 'knumv' to be checked too because it is unique to each order, and I am running this within a loop.
    The format of the code goes like this...
    select distinct ...... into table bodyitab1(internal table)
    *fetching all the information of the sales orders into the table
      insert lines of bodyitab1 into table bodyitabtotal.
    loop at bodyitabtotal
    reading all the data into various variables and reading into 'w_accitab'
      select knumv kschl kbetr kwert kinak
        from konv into table cdata for all entries in 
    bodyitabtotal where konv~knumv = bodyitabtotal-knumv
      *fetching the rates, amounts, for each sales order based on  'knumv' and checking for the condition types
      loop at cdata  into zcdata where knumv = bodyitabtotal-knumv.
         case zcdata-kschl.
            when 'ZAGR'.
       append w_accitab to accitab.
             clear accitab-zamount.
       clear accitab.
          clear w_accitab.
         endloop.
      endif.
    endloop.
    here the loop ends and this completes the cycle for one order
    so when I use the read statement it has to check for 'ZAGR' for that order only but if you see the query
    cdata' has the condition records for all entries in 'bodyitabtotal' because all orders do not have 'ZAGR' condition type
    I hope you understand the flow of the program.
    thanks
    Santhosh

  • Help! Need Abap code in Bex for Customer Exit

    Hi,
    I am new to abap, i need help in creating variable type customer exit.
    i want to create a variable type customer exit the reqmnt is to create a variable that will derive quarter(0CALQUARTER) from FINANCIAL_CLOSING variable.
    Really appreciate if one can provide me the coding for this logic.
    Thanks.

    Hi Yaser,
    Check this below.
    http://scn.sap.com/thread/278890
    Regards.

  • Help with the ABAP code

    Hi "Friends",
    I have small problem, but i don't know how to solve it.
    I changed an old program which had just executable report function. The display was written with "WRITE" sentence.
    here is the code:
               WRITE: / OUTPUT-MATKL(4), '|',
                       T023T-WGBEZ, '|',
                      AT 30 OUTPUT-MATNR+12(6), '|',
                      AT 39 OUTPUT-MAKTX, '|',
                      AT 90 OUTPUT-LABST, '|',
                      AT 110 OUTPUT-OMENG, '|',
                      AT 135 OUTPUT-BMENG, '|',
                      AT 165 VERFUEGBAR, '|'.
    How can I set in new code that the columns will start at the same point?
    New code:
    FORM BUILD_LINE USING  IW_DATA.                             "$001 start
      FIELD-SYMBOLS: <L_VALUE>,                                 "$001
                     <L_DATUM_EX>.                              "$001
      DATA: L_LEN TYPE I.                                       "$001
      DATA: L_STRLEN TYPE I.                                    "$001
      DATA: L_TYPE.                                             "$001
      DATA: H_DATE_EXTERNAL(10) TYPE C.                         "$001
      CLEAR: G_TRANSFER.                                        "$001
      REFRESH:  GTW_FIELDS.                                     "$001
      APP_NAME 'MATKL'.                                        
      APP_NAME 'WGBEZ'.                                        
      APP_NAME 'MATNR'.                                        
      APP_NAME 'MAKTX'.                                        
      APP_NAME 'LABST'.                                        
      APP_NAME 'OMENG'.                                        
      APP_NAME 'BMENG'.                                        
      APP_NAME 'VERFUEGBAR'.
    And my question is how to set in new code that the A column starts AT 30, second AT 90.... How to set this?
    I put the AT 30 infront of the APP_NAME, but doesn't work!! Please help.
    Thanks for the help,
    <b><REMOVED BY MODERATOR></b>... and it is urgent )
    BR
    saso
    Message was edited by: Saso
            Saso Poljansek
    Message was edited by:
            Alvaro Tejada Galindo

    Uf, but I would like to write on unix file now and this write is'n possible anymore...
    Here is the code I need to change... At this piece of code i need to change that the columns will be a the same place as was before when I used write sentance... There is another external program behind and I need to have the same structure as I have before....
    *&      Form  build_line
          text
         -->P_I_DATA  text
    FORM BUILD_LINE USING  IW_DATA.                             "$001 start
      FIELD-SYMBOLS: <L_VALUE>,                                 "$001
                     <L_DATUM_EX>.                              "$001
      DATA: L_LEN TYPE I.                                       "$001
      DATA: L_STRLEN TYPE I.                                    "$001
      DATA: L_TYPE.                                             "$001
      DATA: H_DATE_EXTERNAL(10) TYPE C.                         "$001
      CLEAR: G_TRANSFER.                                        "$001
      REFRESH:  GTW_FIELDS.                                     "$001
      APP_NAME 'MATKL'.                                         "$001
    *****************write also this from the customizing table
      APP_NAME 'WGBEZ'.                                         "$001
      APP_NAME 'MATNR'.                                         "$001
      APP_NAME 'MAKTX'.                                         "$001
      APP_NAME 'LABST'.                                         "$001
      APP_NAME 'OMENG'.                                         "$001
      APP_NAME 'BMENG'.                                         "$001
    *****************write also this from the customizing table
      APP_NAME 'VERFUEGBAR'.                                    "$001
      LOOP AT GTW_FIELDS.                                       "$001
        CLEAR SY-SUBRC.                                         "$001
        ASSIGN COMPONENT GTW_FIELDS-NAME OF STRUCTURE IW_DATA   "$001
                                                TO <L_VALUE>.   "$001
        CHECK SY-SUBRC = 0.                                     "$001
        DESCRIBE FIELD <L_VALUE> OUTPUT-LENGTH L_LEN.           "$001
        DESCRIBE FIELD <L_VALUE> TYPE L_TYPE.                   "$001
        CASE L_TYPE.                                            "$001
          WHEN 'D'.                                             "$001
            CLEAR: H_DATE_EXTERNAL.                             "$001
            ASSIGN H_DATE_EXTERNAL TO <L_DATUM_EX>.             "$001
            CALL 'DATE_CONV_INT_TO_EXT'                         "$001
              ID 'DATINT' FIELD <L_VALUE>                       "$001
              ID 'DATEXT' FIELD <L_DATUM_EX>.                   "$001
            UNASSIGN: <L_VALUE>.                                "$001
            ASSIGN <L_DATUM_EX> TO <L_VALUE>.                   "$001
        ENDCASE.                                                "$001
        L_STRLEN = STRLEN( G_TRANSFER ).                        "$001
        WRITE <L_VALUE> TO G_TRANSFER+L_STRLEN(L_LEN).          "$001
        L_STRLEN = L_STRLEN + L_LEN.                            "$001
        WRITE '|' TO G_TRANSFER+L_STRLEN.                       "$001
        AT LAST.                                                "$001
          SHIFT G_TRANSFER BY 1 PLACES RIGHT.                   "$001
          WRITE '|' TO G_TRANSFER+0(1).                         "$001
        ENDAT.                                                  "$001
        CLEAR: L_STRLEN.                                        "$001
      ENDLOOP.                                                  "$001
    ENDFORM.                    " build_line                    "$001 end

  • Help with some ABAP code

    I am trying to fill the quantity value if it is blank by looking for a record with the key and putting it's value in it.  the code is below but the part whee it says where order_qty > 0 is not working.  It just hops out even if it is.
    CLEAR: T_SCHED_DATA, T_QUANTITY_DATA.
      REFRESH: T_SCHED_DATA, T_QUANTITY_DATA.
      SELECT DOC_NUMBER S_ORD_ITEM SCHED_LINE DSDEL_DATE REQ_DATE ORDER_QTY
       INTO TABLE T_SCHED_DATA
       FROM /BIC/AZSCH_O5400
         FOR ALL ENTRIES IN DATA_PACKAGE
        WHERE
         DOC_NUMBER = DATA_PACKAGE-DOC_NUMBER AND
         S_ORD_ITEM = DATA_PACKAGE-S_ORD_ITEM AND
         SCHED_LINE = DATA_PACKAGE-SCHED_LINE.
      SELECT DOC_NUMBER S_ORD_ITEM SCHED_LINE DSDEL_DATE REQ_DATE ORDER_QTY
       INTO TABLE T_QUANTITY_DATA
       FROM /BIC/AZSCH_O5400
        FOR ALL ENTRIES IN T_SCHED_DATA
        WHERE
         DOC_NUMBER = T_SCHED_DATA-VBELN AND
         S_ORD_ITEM  = T_SCHED_DATA-POSNR.
      T_QUANTITY_DATA2[] = T_QUANTITY_DATA[].
      sort t_quantity_data2 by vbeln posnr SCHED_LINE
           ascending.
    sort t_quantity_data by vbeln posnr SCHED_LINE
           ascending.
      loop at T_QUANTITY_DATA into LF_DATA
        where order_qty > 0.
          loop at T_QUANTITY_DATA2 into LF_DATA2
          where
           vbeln = LF_DATA-VBELN AND
           posnr = LF_DATA-POSNR AND
           DSDEL_DATE = LF_DATA-DSDEL_DATE AND
           SCHED_LINE NE LF_DATA-SCHED_LINE and
           order_qty = 0.
            lf_data3 = lf_data2.
            move LF_DATA-order_qty to lf_data3-order_qty.
            append lf_data3 to T_QUANTITY_DATA3.
          endloop.
      endloop.

    loop at T_QUANTITY_DATA into LF_DATA
    where <b>order_qty > 0.</b> <b> " when this is greater than zero</b>
    loop at T_QUANTITY_DATA2 into LF_DATA2
    where
    vbeln = LF_DATA-VBELN AND
    posnr = LF_DATA-POSNR AND
    DSDEL_DATE = LF_DATA-DSDEL_DATE AND
    SCHED_LINE NE LF_DATA-SCHED_LINE and
    <b>order_qty = 0.</b>  <b>" how can it be zero here</b>
    lf_data3 = lf_data2.
    move LF_DATA-order_qty to lf_data3-order_qty.
    append lf_data3 to T_QUANTITY_DATA3.
    endloop.
    endloop.

  • ABAP Code Date Selection for InfoPackage Scheduler

    Hello Group
    I need to automate the selection of valid condition records for an extraction that have a From and To date range.
    I noticed there is an option (Routine for time interval) to write ABAP code along with a template that is available in the InfoPackage.
    I think the logic for the selection would be any record
    Valid from       <= today
    Valid to           >= today
    Can anyone help with the ABAP code?
    The template is as follows:
    program conversion_routine.
    Type pools used by conversion program
    type-pools: rsarc, rsarr, rssm.
    tables: rsldpsel.
    Global code used by conversion rules
    $$ begin of global - insert your declaration only below this line  -
    TABLES: ...
    DATA:   ...
    $$ end of global - insert your declaration only before this line   -
    form compute_time_dependent_dates
      changing p_datefrom type d
               p_dateto   type d
               p_subrc like sy-subrc.
          Insert source code to current selection field
    $$ begin of routine - insert your code only below this line        -
              p_datefrom =
              p_dateto   =
              p_subrc = 0.
    $$ end of routine - insert your code only before this line         -
    endform.
    Thank You for your help!!
    Frank

    I resolved the problem . I have changed the order of read table l_t_range because I need the header .
    In the loop at datos I add the line l_t_range-iobjnm = 'ZXGE_UNO'.
    The problem wasn't the call RFC it was that I built l_t_range bad. I need the infoObject name.
    This is correct!!
    READ TABLE L_T_RANGE WITH KEY
             FIELDNAME = '/BIC/ZXGE_UNO'.
    LOOP AT DATOS.
          L_T_RANGE-FIELDNAME = '/BIC/ZXGE_UNO'.
          L_T_RANGE-IOBJNM = 'ZXGE_UNO'.
          L_T_RANGE-SIGN = 'I'.
          L_T_RANGE-OPTION = 'EQ'.
          CONCATENATE '00' DATOS-WA+3(4) INTO L_T_RANGE-LOW.
          APPEND L_T_RANGE.
        ENDLOOP.
    *READ TABLE L_T_RANGE WITH KEY+
    +*FIELDNAME = '/BIC/ZXGE_UNO'.+
    +*    L_IDX = SY-TABIX.+
    +*    MODIFY L_T_RANGE INDEX L_IDX
    Thanks a lot
    Ana

  • Urgent: ABAP Code help reqd

    Hi,
    Can anyone please me provide me ABAP code for the following case:
    Table1 – JHAGA
    Table2 – JHAGVZ
    Primary keys in JHAGA:
    Order Item Number [POS_NR]
    Billing Dataset [GRUPPABRNR]
    Sales Document Number [AVM_NR]
    This requirement is for an InfoSet. For each order ideally we can have multiple sales agent. Sales Agent is being pulled from JHAGVZ. For this InfoSet we are going to go with assumption that we wont have more then 10 sales agent for an order,
    Consider 10 extra fields in InfoSet SA1 – SA10 for 10 Sales Agent.
    I need code which to populate this sales agent field. If an order exists in JHAGA then for that order in JHAGVZ populate the SA1-SA10 field.
    JHAGA – Order#10
    JHAGVZ – Order#10 – SalesAgent11
                   SalesAgent12
                   SalesAgent13
    Then SA1 should have SalesAgent11, SA2 should have SalesAgent12 and SA3 should have SalesAgent13 and so on…     
    Thank you,
    sam

    HI ,
    Are these two field a part of the table INFOROBJECT?
    if they are, you can write a select statement like :
    select 0CUSTOMER 0SALESORG YLEG_ENTITY
           from INFOROBJECT
           into Y_CUST_LE
           where ( Yacc_SEQ <> ´ZROO´  and
                   0PRICE_LIST <> space).
    Hope this helps.
    If not, please explain problem clearly.

  • Need ABAP code to make unique hierarchy values - Request prompt help

    hi
    <removed>
    I am new to SAP. Please help me in the following
    I require an ABAP code for the following scenario
    I have a simple hieraarchy. The hierarchy is
    SEG -> fam -> clas -> comm
    The values of the seg , fam, cla, com......all will be charecter values
    But in some cases the values will be NOT_KNOWN
    If the values are NOT_KNOWN i need to change them as NOT_KNOWN_1, NOT_KNOWN_2...like that unique charecter values
    should be replaced for NOT_KNOWN
    Example
    SEG->FAM->CLA ->COM
    Clothing -> Mens wear -> Designer garments -> NOT_KNOWN
    Construction -> equipments -> machinery->NOT_KNOWN
    Computers -> Laptops -> Imported -> NOT_KNOWN
                     -> desktops ->flat monitors -> Indian
                           -> imported                     -> NOT_KNOWN->
    NOT_KNOWN -> baggages
    This should be changed to
    SEG->FAM->CLA ->COM
    Clothing -> Mens wear -> Designer garments -> NOT_KNOWN_1
    Construction -> equipments -> machinery->NOT_KNOWN_2
    Computers -> Laptops -> Imported -> NOT_KNOWN_3
              -> desktops ->flat monitors -> Indian
                              -> imported                         
           -> NOT_KNOWN_4 ->
    NOT_KNOWN_5 -> baggages
    This is to make them unique nodes to upload them in hiereachy
    Data is coming from database tables and i was not supposed to do anything in database and the incomin
    data needs to finetuned like this to update them in cube
    So I like to have some coding which will enable this to work in the start routine
    If start routine is not the right option, where else we can do coding
    <removed>
    Regards
    KC

    data : w_suff_n(8) type n,
             w_suff_c(8).
    loop at data_package.
    if data_package-<fieldval> = 'NOT_KNOWN'.
      w_suff_n = w_suff_n + 1. w_suff_c = w_suff_n.
      shift w_suff_c left deleting leading '0'.
      concatenate data_package-<fieldval> w_suff_c into data_package-<fieldval>.
      modify data_package.
    endif.
    endloop.
    *Change <fieldval> in the above to the actual field name.

  • ABAP code Help for Customer Exit variable

    Hello All,
    Can anyone provide ABAP code for a customer exit variable please?
    Requirement:
    0CALYEAR(InfoObject) - ZCALCYR (Variable) <b>Calender year with default value actual year</b>.
    Proiperties of variable: single value,mandatory,ready for input,can'be changed in query navigation.
    i have read some docs on customet exit variables which i got from SDN but i found it's difficult for me to get this as i am not that good in ABAP.
    Thanks,
    Rakesh.

    Hi,
       Just check the below code. You just need to make slight changes I believe. Hope this helps you.
    In CMOD………..
    Sample code
      INCLUDE LXRSRF01                                                   *
    data: l_s_range type rsr_s_rangesid.
    case i_vnam.
      when 'ZCALCYR'.
        if i_step = 1.
         l_s_range-low = sy-datum+0(4).
            append l_s_range to e_t_range.
        Endif.
    Endcase.

Maybe you are looking for

  • Unable to login Apex Admin

    11gR1 installed on Windows XP Pro SP3 I can get to the admin login page but when I try to login nothing happens. This seems like a common problem but the solution is not clear to me. I had 11g installed with Apex 3.0 so I upgraded it to 3.2.1 by usin

  • Memory does not get released after encrypting/ decrypting files.

    I am using javax.crypto package to encypt/decrypt files but the problem is that once a big file (around 100- 700 mb) is encrypted there is spike in memory of 70 Mb (first time) and whole of this memory is not released after execution is finished. I h

  • Being able to 'Read & Write' on an external hard drive on the Mac

    Hi there, I can't seem to be able to add things to my external hard drives on my MacBook Pro. I can with my USB stick but not with the larger external hard drives. Could someone help me change the permission settings to allow me to 'Read & Write' rat

  • Recovering catalog from a disk backup

    I've recently had a disk failure, so I need to recover all of my pictures and PSE catalog. I don't have a backup done by PSE, but I do have a comprehensive backup of everything that was on the failed disk. How do I get my PSE catalog back the way it

  • ICal calendars on my Mac don't sync with iCloud

    Am I missing something? When I configured iCloud, I noticed that I suddenly had duplicates of my Address Book and Calenders. My Mac can sync with my phone, my phone can sync with iCloud, but I can't sync my Mac with iCloud. Maybe I'm too lazy and hav