Abap Code populate only the entries withUser Input Posting Date =pstdate

Requirement: I have Posting Date for all Objects Now i want to create the <b>Variable “PSTVAR”</b>such that the variable will populate <b>only the entries with
User Input Posting Date(During Report Execution) >=greater than equal to Posting Date(OPSTDATE). .</b>
<b>Example</b> POSTING DATE = 03032007
POSTING DATE = 01012006
IF USER INPUT DATE = 01012007
Then only POSTING DATE = 03032007 will show up in report
write the code in <b>customer exit cmod in BI</b> if CAN CORRECT THE CODE WOULD BE GREAT
Data: l_s_var_range Type rrangeexit.
L_d_PSTDATE Type /bio/oipstdate.
L_d_PSTDATE Type /bio/oipstdate.
IF I_STEP=2.
READ TABLE I_t_var_range INTO l_s_var_range WITH KEY VNAM = ‘PSTVAR’.
If L_d_PSTDATE >= PSTVAR’
L_d_PSTDATE=l_s_var_range-low(0)
Please help me modify the above code with logic or with some extra line of code to solve my requirement. Appreciate all of you for help in advance
Thanks
Soniya Kapoor

You have to write the code (<b>in BI/BW</b>) in the transfer rule (<b>between Datasource transfer structure and infosource/info object</b>)
There the FORM begin with
[code]USING RECORD_NO LIKE SY-TABIX
    TRAN_STRUCTURE TYPE TRANSFER_STRUCTURE
    G_S_MINFO TYPE RSSM_S_MINFO
CHANGING RESULT TYPE /BI0/OIPERSON
    G_T_ERRORLOG TYPE rssm_t_errorlog_int
    RETURNCODE LIKE SY-SUBRC
    ABORT LIKE SY-SUBRC. “set ABORT <> 0 to cancel datapackag[/code]
GS_MIN_INFO structure RSSM_S_MINFO contains information on the request being processed.
<i>G_S_MINFO. This passes technical information about the data load request,
such as requesting user, request date and time, update mode, the handling of
duplicate records, error handling flags, parallel processing flags, and what data
targets to update.</i>
If tou want to use start-routine for optimization reasons and fill an empty field in transfer structure, the structure G_S_MINFO is available too.
[code]USING G_S_MINFO TYPE RSSM_S_MINFO
CHANGING DATAPAK type TAB_TRANSTRU
    G_T_ERRORLOG TYPE rssm_t_errorlog_int
    ABORT LIKE SY-SUBRC. “set ABORT <> 0 to cancel datapackage[/code]
And stay in FORM between limits :
[code]$$ begin of routine
$$ end of routine[/code]
Update RESULT in first case, and field(s) of DATAPAK in second case.
[code]RESULT = G_S_MINFO-LOGSYS.[/code] or
[code]LOOP AT DATAPAK INTO l_s_datapak_line.
  l_s_datapak_line-zzsourcsys = G_S_MINFO-LOGSYS.
  MODIFY DATAPAK FROM l_s_datapak_line.
ENDLOOP.[/code]
Regards

Similar Messages

  • TS3899 I can preview email when it arrives (I chose 5 lines) but when I then go to open up the full email, I see only the header info (To, Subject & Date); nothing in the body...it is blank.  This only started recently as before, it worked as expected. He

    I can preview email when it arrives (I chose 5 lines) but when I then go to open up the full email, I see only the header info (To, Subject & Date); nothing in the body...it is blank.  This only started recently as before, it worked as expected. Help?

    I have two yahoo accounts and I know as they 'improved' their servers I had periodic outages. It'd work fine on my webmail on  my computer, webmail on the iPad, but not via the mail app. And it was stuff on their end. It may be a case of wait and see and you may need to eventually remove/readd the account on your iPhone.
    When the issue is on their end, unfortunately there's not much for users to do beyond wait it out or find work arounds.

  • Reports / intranet/ In some detail,  the user will input a date range from and 2 and will out put the records in the int

    Hello there,
    I am totally green in web development.
    my goal is to, for the user will input a date range from and
    to and will out put the records in the intranet when they press a
    button.
    However, the good news is: I have experience in programming.
    I have written applications for desktop in VB>NET and I
    understand RDBMS /sql concepts .
    But CF and WEB development is new to me.
    My current projects involves in connecting to DB and testing
    it. (it works fine)
    And outputting reports by to a intranet page. (records)
    i need help on how to start this asap. I will even do some
    practice at home.
    Tools I have at work
    • Development server(test)
    • Home site.
    • Toad for db connection.
    • Html reference guide
    • Cf dummies book.
    How can start my projects.
    (ex. Create cf, outputpage?)
    seriously, I am new to this.
    Thanks.

    Well, I had a really nice response with some concepts and
    ideas for you to practise on etc, but these dumb forums timed out
    and I lost it all
    If you want to pop me an email we could probably do a few
    exercises together that way - or even by MSN Messenger if you want.

  • Exchange rate coefficient on the basis of latest posting date in invoice.

    Hi,
    I have one query on posting date(picking of exchange rate coefficient from TCURR table) in invoice verification.  Please help.
    Conditions are--
    vender and company code are not in same currencies(ex-USD and INR). exchange currencies are maintained perfectly on every month 1st ie co-efficients in TCURR table ie OB08
    Query---
    1.At the time of parking invoice suppose i enter the date 20th august and i have posted that invoice as parking. It is converting the local currency as per 8th month exchange rate.
    2.And at the time of final posting the invoice supose i posted that date as 10th September. Business wanted that converting the local currency as per 9th month exchange rate But now local currency is converting on the basis of initial entry of posting date ie 8th month only.
    Please advise and guide what configeration that i have to set for picking the exchange rate coefficient on the basis of latest posting date in invoice verification.
    Thanks & Regards,
    MadhuBabu.

    Hi
    I dont think it is possible as once you enter posting date while in parking invoice screen, on that date exchange rate will be calculated and it wil not be different at time of posting invoice. Instead of parking, you have to directly post with current posting period.
    Thanks

  • Need ABAP Code to enhance the 0PRODORDER_ATTR?

    I want to enhance the datasource 0PRODORDER_ATTR with the below JCDS Table fields like UDATE,STAT,OBJNR,INACT,CHGNR.
    Can anyone please let me know the ABAP Code need to be written in the CMOD to populate the data for the above fields in the 0PRODORDER_ATTR?

    Hi,
    You can use below code to enhancemnt .
    You need to change the table, structure and field names
    Below code you have to write in tocde CMOD if you are enhancing the master data. It applies for any master data, although, I have taken 0VENDOR_ATTR as the example. I assume that You have already added/appended  the fields in the extract structure of 0VENDOR_ATTR  i.e. to the structure BIW_LFA1_S. ( Check this link for how to enhance the DataSource : https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/b0af763b-066e-2910-a784-dc6731660f46 )
    We have enhanced the datasorce for the following two fields from table LFA1:
    ERDAT- Date on which the Record Was Created
    KRAUS - Credit information number.
    We have also enhaced the structure for the following fields from table LFB1.
    MINDK - Minority Indicators
    ZTERM - Terms of payment key
    CERDT - Certification date.
    Now we will poulate these two fields in the code written in CMOD tcode. Here is the code:
    Go to the tcode CMOD in R3 and select the component EXIT_SAPLRSAP_002. Write this code in INCLUDE ZXLOFU01.
    data : l_t_data like biw_lfa1_s.
    data : l_tabix like sy-tabix.
    CASE i_datasource.
    WHEN '0VENDOR_ATTR'.
        LOOP AT  i_t_data INTO l_t_data.
          l_tabix = sy-tabix.
          CLEAR:  l_t_data-yyerdat,
                 l_t_data-yykraus.
          SELECT SINGLE  erdat kraus FROM lfa1 INTO
              ( l_t_data-yyerdat, l_t_data-yykraus)
                WHERE lifnr EQ l_t_data-lifnr.
          SELECT SINGLE mindk zterm cerdt FROM lfb1 INTO
                  (l_t_data-yymindk, l_t_data-yyzterm, l_t_data-yycerdt)
                  WHERE lifnr = l_t_data-lifnr.
          MODIFY i_t_data FROM l_t_data INDEX l_tabix.
          CLEAR: l_t_data, l_tabix.
        ENDLOOP.
    ENDCASE.
    Labels parameters

  • Executing Abap Queries in Abap Code and processing the result

    Hi,
    I want to execute ABAP Queries (designed by sq01) in an abap report and processing the result in an internal table.
    How could it be work?
    Thanks a lot for your responses,
    with kind Regards
    Reinhold Strobl

    Hello,
    GO to SQ01 and select your query. Go to Menu QUERY-->More Functions->Display Report Name.
    You can then take that report name and go to SE38. Copy the code before END-OF_SELECTION and then modify as per your own requirements.
    Regrads
    Saket Sharma

  • Need help in ABAP code to Enhance the Extract Structure ?????

    Hi all,
        I want to enhance the extract structure to get KBETR & KBRUE fields of KONP table since it didn’t allow me to add those fields while creating the generic extractor because of currency key problems. I want to read all KONP records into internal table with KNUMH (Key). Next, I want to fill them into ZZKBETR & ZZKBRUE of Extract Structure ZOXUR40065 in loop.
    DATA:
      i_t_zrebate like ZOXUR40065 occurs 0 with header line,
      reb_tabix like sy-tabix.
    TABLES: KONP.
      Could you please help me in completing the ABAP code?
    Thanks,
    Venkat.

    Hello Manga,
        I have included the following code in ZXRSAU01:
    WHEN 'ZREBATE'.
    PERFORM ZREBATE_EXIT TABLES C_T_DATA.
    After Double click on ZREBATE_EXIT on perform statement, it created ZXRSAF01 include and the following code is added in it:
    FORM ZREBATE_EXIT TABLES FP_C_T_DATA STRUCTURE ZOXUR40065.
    DATA:
    i_t_zrebate like ZOXUR40065 occurs 0 with header line,
    reb_tabix like sy-tabix.
    FIELD-SYMBOLS: <l_c_t_data> TYPE ZOXUR40065.
    LOOP AT fp_c_t_data ASSIGNING <l_c_t_data>.
    reb_tabix = sy-tabix.
    select single KBETR KBRUE
    into (<l_c_t_data>-ZZKBETR,
    <l_c_t_data>-ZZKBRUE,
    from KONP
    where KNUMH eq <l_c_t_data>-KNUMH.
    if sy-subrc eq 0.
    MODIFY fp_c_t_data FROM <l_c_t_data> INDEX reb_tabix.
    endif.
    CLEAR:reb_tabix.
    ENDLOOP.
    ENDFORM.
    When I tried to Activate this ZXRSAF01 include, it fails with 'The FORM "ZREBATE_EXIT" does not exist'.
      Should it be FP_C_T  or P_C_T? I found P_C_T in ZXRSAF01 include.
      What is wrong with it, please ?
       Can't I add this whole code in main include ZXRSAU01itself?
      The Extractor ZREBATE is based on KONA, KONH & KONP tables. This Extractor and KONA table have the same 4000 records and KONP has 13000 records. I want to extract KBERT & KBRUE from KONP.
       Thanks in advance.
    Regards,
    Venkat

  • Abap code to replace the bank values of Date Field with 20990101

    Please correct my abap code I am just trying to replace the bank values of Dataefield to 20990101 but i am getting the error invalid dataformat '00000000 '. Please correct my IF statement so that I can get this resolved
    IF    SOURCE_FIELDS-DATETO = '00000000 '
          RESULT = '20990101'.
    ENDIF.
    Thanks'
    Soniya

    Hi Soniya,
    You can use one of the following:
    IF SOURCE_FIELDS-DATETO =  ' '.
    RESULT = '20990101'.
    ENDIF.
    or
    IF SOURCE_FIELDS-DATETO IS INITIAL.
    RESULT = '20990101'.
    ENDIF.
    or
    IF SOURCE_FIELDS-DATETO = '00000000'.
    " THERE WAS A SPACE IN YOUR CODE.
    RESULT = '20990101'.
    ENDIF.
    Regards,
    Satya

  • ABAP Store ABAP code locally  on the disk

    Hello
       I have a question, how download the Web dynpro ABAP code from the SAP System.
    Could You give me a hint how to save code locally on the disk?
    Regards
    Wojtek

    I started from http://code.google.com/p/saplink/ .
    Then in http://code.google.com/p/saplink/wiki/pluginList I found the plug-in for ABAP Web Dynpro.
    It still in ALPHA status and to be honest I got trouble installing it (in fact there is the note:  But WDA plugin requires SAPlink 0.1.3 or greater).
    You should get it running because I can see the nugg file.
    Eventually ask navigate to the http://code.google.com/p/saplink/issues/list and the other pages of http://code.google.com/p/saplink.
    Sergio

  • ABAP code for caliculating the demand variability

    Hi gurus,
    I need to calculate the the demand variability for the requested raw material,
    Demand Variability for raw materials is calculated by taking the standard deviation of 52 data points, each point representing the total consumption in a week.
    The raw consumption data contains negative figures on many days, resulting from inventory adjustment transactions.  Aggregate consumption to a weekly bucket to keep variability from being artificially inflated by any negative figures from adjustments due to physicals, poor practices, or cycle counts.
    Calculation
    Calculate the consumption for every week based on MSEG-MENGE where MKPF-BUDAT falls within the week bucket from Sunday till Saturday. This is the value Xn.
    SUM all 52 Xn values for every week. This is Y.
    Divide the Y/52 = Z
    Calculate for that year the standard deviation
    SQRT (((Xn-Z)2)/n)
    Can you any one give the code for this condition.
    Thanks in advance.

    any help please...

  • Abap Code to Repeat the field (3nos) Values for all the fields

    Hi Friends I have a Requirement to merge the Data for One of my BI - BCS model.
    I have fields in one table(/BIC/AZDBBCP_040) <b>business Num , PRCTR, REGION  and RELOCAT</b>  and Field ZAUD_TYP and Audit Year Zyear also in same table.
    But I want to reapeat this information Highlighted in Bold for all the Zaudtyp and ZYEAR. Please help me with the Code
    <b>Problem as below</b>
            BUSNUM  PRCTR  REGION  RELOCAT   ZAUD_TYP  ZYEAR
              101     22    ALAN      MN           
              101                                                                                GT(ZAUD_TYP)        1999(ZYEAR)
    101                                      BTE         2001
    102          25          CA        SFO          
               102                           LTE         2008
    Please help me with any Code to fix the problem so that the data repeat for PRCTR  REGION  RELOCAT  where Bus Num is same.
    Kindly Get me any ABAB Code . Will really be thankful to you
    Regards
    Soniya Kapoor
    soniya kapoor
    Message was edited by:
            soniya kapoor

    Hi Soniya,
    You can use one of the following:
    IF SOURCE_FIELDS-DATETO =  ' '.
    RESULT = '20990101'.
    ENDIF.
    or
    IF SOURCE_FIELDS-DATETO IS INITIAL.
    RESULT = '20990101'.
    ENDIF.
    or
    IF SOURCE_FIELDS-DATETO = '00000000'.
    " THERE WAS A SPACE IN YOUR CODE.
    RESULT = '20990101'.
    ENDIF.
    Regards,
    Satya

  • ABAP Program to delete the WDSO contents from active data table & Manage Re

    Hi,
    We have requirement where we have to delete the request id from manage screen and data from Active table of WDSO.
    I have gone through this weblink where we have to hardcode the DSO name in the table (Deletion of WDSO (Write-optimized DataStore object) Load requests and active table data without deleting it from targetSAPNetworkWeblogs%2528SAPNetworkWeblogs%2529)
    Apart from that is there any suggestions or input where i can have selection screen for DSO and execute that will help us to delete the Request IDs and content of active table from WDSO.
    Suggestions or input programs really appreciated.
    Kindly do the needful.
    Regrads,
    Prem
    Edited by: pannalde on Nov 22, 2011 8:24 AM

    Hi,
    http://help.sap.com/saphelp_nw04/helpdata/en/2d/677b3c513d3311e10000000a114084/content.htm
    With program RSSM_DELETE_WO_DSO_REQUESTS it is possible to delete old requests in the Write-Optimized DSO, exactly like we are used to do with PSA requests via a Process Chain.
    This program is available as of SAP NetWeaver BW 7.01 SP07. See note 1437407 for details.
    You can automate the deletion of old WO requests by using the ABAP program step in the Process Chain.
    Regards,
    rvc

  • How can I prevent the entry of a future date in my date field?

    Hi,
    I have a date field in my form (created w/ Adobe Lifecycle Designer v8.0) and I need to prevent users from entering a future date (current or past date is okay). Ideally, if a future date is entered, an error message pops up and tells the person that a future date is not acceptable. Does anyone know how to do this or have any suggestions to try?
    Thanks,
    Annie

    hi Annie,
    place the below code in the exit event of the date field and script language should be FormCalc
    if 
    ($.rawValue <> null )
    thenvar 
    num = IsoDate2Num($.rawValue)-Date() 
    if 
    ( num > 0 )
    then
    $host.messageBox("Invalid Date and cannot be Future Date")
    $.rawValue= ""$host.setFocus("your field path")
    endif
    endif
    Note : your field path for example your date field name is futuredate under subform name body then place body.futuredate.
    if you want to resrict not to enter past date then compare num with < 0 or to current date then compare num with = 0.
    Thanks,
    Madhu.

  • Abap Code to Delete the Duplicate Entries in Datasource

    hI Friends I have a code that I am writing to delete the duplicate entries from CRM Custom Datasource  but it is throwing me error that INVERNO The specified type has no structure and therefore no component called INVERNO Should i define the structure please correct my code below so that it will work to delete the duplicate entries          
    Please help
    Data: l_s_ZOXD530051 like ZOXD530051. ***Extract Structure of Data source
    Case i_DATASOURCE.
    when 'ZZ_DS_CUSTOM_CRM_VALUES'.
    Sort C_T_DATA by INVERNO ZMKT_TYP.
    *write this Statement.
    DELETE ADJACENT DUPLICATES FROM C_T_DATA COMPARING INVERNO ZMKT_TYP.
    endcase.
    Thanks
    Soniya
    null

    Hi
    It means there's no field called INVERNO:
    Data: l_s_ZOXD530051 like ZOXD530051. ***Extract Structure of Data source
    Case i_DATASOURCE.
    when 'ZZ_DS_CUSTOM_CRM_VALUES'.
    <b>*Sort C_T_DATA by INVERNO ZMKT_TYP. <------</b>
    Sort C_T_DATA by INTRENO ZINS_TYP.
    *write this Statement.
    DELETE ADJACENT DUPLICATES FROM C_T_DATA COMPARING INTRENO ZINS_TYP.
    endcase.
    Max

  • ABAP Code Split at the decimal

    Dear experts,
        I have a small requirement where in I need to split the qty at the decimal place and use the non decimal value as a character field.
    Eg: WA_ITAB-LFIMG = 12.000
    I want only 12 into one variable which has only capacity of 4 characters (Lfimg has 1313 characters).
    I tried the following code, but it did not work.
    I was able to successfully split the value and pass it onto the corresponsing entries but unable to pass the value into a variable of 4 characters,
    Can some one please help me in this.
    It_itab has lfimg
    data : var(17) type c,
           qty(13) type c,
           qty_dec(3) type c,
           val(4) type c.
    constants : ca(1) type c value '.'.
    read table it_itab into wa_itab index 1.
    var = wa_itab-lfimg.
    split var at ca into qty qty_dec. " This worked
    val = qty. " This did not work
    Thanks
    -Amit

    Hi Amit,
    use TRUNC function:
    data :
      qty_dec(3) type c,
      val(4) type c.
    val = trunc( WA_ITAB-LFIMG ).
    qty_dec = ( WA_ITAB-LFIMG - trunc( WA_ITAB-LFIMG ) ) * 1000.
    Regards,
    Clemens

Maybe you are looking for

  • Can't update AIR, asks EULA forever.

    Can't update AIR. I'm using htc sync and each time I try to update AIR aks to accpet EULA. There is a problem in the Windows log . As my W7 is in spanish the message is in spanish. I also attach the last lines of the air log. [2013-01-08:18:14:32] be

  • Convert photos of buildings to line art.

    I am looking for a program that can convert photos of buildings to crisp, clean line art with no shadings or noise. Is there a program that can do this? If not what would come closest to what I need and I can test it. Thank you. Lisa

  • "Submit by Email" Button in a X Pro form.......

    I have created a form in X Pro and added a Button at the bottom of the form for the submitters to just click and the completed form will be emailed to me.  I tried to add some Java Script that would send the email and the completed form to a Specific

  • BlackBerry Q5 reset to factory setting after upgrade

    This Topic has been Moved for correct placement

  • CKM3 - PPV analysis: split between exchange rate effect and price effect

    Dears, I need to verify how the purchase price variance (PPV) is calculated within the Material Ledger, specifically regarding the split between exchange rate effect and price effect. I found transaction CKM3 that display the exchange rate difference