Getting the variant name when the report program is run in background

Hi All,
How to get the variant name for the report program when run in background? My requirement is to create an email attachement with the name 'variant.XLS', where variant = selection screen variant, when the report program is run in background. The system field SY-SLSET holds the variant name only when run online.
Any pointers to this will be highly appreciated.
Thanks and regards,
Nilesh.

Hello Nilesh,
Please find the algo:
1. Call the FM: GET_JOB_RUNTIME_INFO to get the background job details.
2. Select data from TBTCP using these details:
DATA:
FP_EVENTID   TYPE BTCEVENTID
FP_EVTPARM   TYPE BTCEVTPARM
FP_ACTIVE    TYPE BTCXPGFLAG
FP_JOBCNT    TYPE BTCJOBCNT
FP_JOBNM     TYPE BTCJOB
FP_STEPCNT   TYPE BTCSTEPCNT.
  CALL FUNCTION 'GET_JOB_RUNTIME_INFO'
    IMPORTING
      EVENTID                 = FP_EVENTID
      EVENTPARM               = FP_EVTPARM
      EXTERNAL_PROGRAM_ACTIVE = FP_ACTIVE
      JOBCOUNT                = FP_JOBCNT
      JOBNAME                 = FP_JOBNM
      STEPCOUNT               = FP_STEPCNT
    EXCEPTIONS
      NO_RUNTIME_INFO         = 1
      OTHERS                  = 2.
  IF SY-SUBRC <> 0.
*   Error calling FM: GET_JOB_RUNTIME_INFO
  ENDIF.
DATA: FP_VARIANT TYPE BTCVARIANT.
  SELECT JOBNAME JOBCOUNT STEPCOUNT VARIANT
  FROM   TBTCP
  INTO TABLE L_IT_TBTCP
  WHERE  JOBNAME   = FP_JOBNM
  AND    JOBCOUNT  = FP_JOBCNT
  AND    STEPCOUNT = FP_STEPCNT.
  IF SY-SUBRC = 0.
    SORT L_IT_TBTCP BY JOBNM JOBCNT STEPCNT.
    READ TABLE L_IT_TBTCP INTO L_WA_TBTCP INDEX 1.
    IF SY-SUBRC = 0.
      FP_VARIANT = L_WA_TBTCP-VARIANT.
    ENDIF.
  ENDIF.
Hope this helps.
BR,
Suhas

Similar Messages

  • Get the variant name of the job shceduled in the Background

    Hello All,
    I am shcduling printout of the Payment Document from F110 transaction code in background.
    My requirement is to get the variant name.
    F110 create background job for printing and when i debug it the value of sy-SLSET it is coming some
    junk value like &000000012.
    I can not schedule this job from  SM36. I have to go for F110 only.
    Is there any way to get the variant name of the background job.
    Kindly help.
    Regards
    Sachin

    Hi,
    I am running F110 by maintaning three variant at the same time.
    So my program will run three times for these three variant.
    Depending upon the variant i have to perform some validations.
    So I want to know the variant name for each one run.
    I am maitaing the variant but when i checked the system field sy-SLSET it is coming some junk value '&000000013'.
    How to get the variant name from this.
    Regards
    Sachin Yadav

  • How to get the VARIANT name in the program

    Hi Guys,
    Can somebody tell me how to get  the VARIANT name in a program.
    I have to perform some code with specific variant only. So I want to check in program which variant has been used to call the program.
    Thanks,

    Hi,
    Variants are stored in table VARI and VARID.
    You can use RS_ALL_VARIANTS_4_1_REPORT to get all the variants for a report program.
    please check out the link below it will be helpful to you
    Re: Programs for a transaction variant
    Hope this helps.
    ashish

  • How to get the variant name from the Selection Screen

    Hi Friends,
                       I have a Selection Screen with Variants.In the Report which is classical,i need to get the <b>name</b> of the variant which is used in the selection screen..Can anyone help me in this?

    You can use system variable
    SY-SLSET
    Thanks
    Seshu

  • Variant Name of the program

    Dear user,
    I want to find out who has changed the setting of the Variant Name of the program.
    Is there any table that captured the changes as well as the original setting before the new changes?
    Thank you.

    Hi,
    Thank you. This is what I want. By the way, is there any table that capture the original value before the changes?
    Eg CDHDR
    Thank you.

  • To display the selection screen variant name in WAD report output.

    Hello experts,
    I have a requirement which is to display the selection screen variant description in the output of the WAD report.
    I managed halfway, by using the object "Information field", which displays all the values which are selected by the variant.
    Example:I have created a cost center report created using WAD, since I need some graphical displays..
    In the selection screen, I have the characteristic "cost center" as input field. I have created a variant " GM - IT" which will include few cost centers managed by GM. In the output, I want the dispaly to be "Cost center - GM IT". Currently it displays "Cost Center - a,b,c,d" as the values a,b,c,d are the values from the variant name "GM-IT"
    Please let me know if this required any java script. I am not familiar with java / html codes and any help would be much appreciated (and rewarded)
    Thanks in advance
    KS

    Hi,
    Try this.
    If you want to include your variables in your WAD means you have to choose "Force Variable Screen" option to be in enabled condition.
    TO enable this,in WAD select your Template(New Template1) click the WEBITEM , it'll shows all generic properties , here you can enable this "Force variable screen"
    Save and execute your WAD now you can get your variable screen.
    Thanks,
    JituK

  • From which table could i get all the Variants of a specific ABAP program?

    Hi,
    From which table could i get all the Variants name which belong to a specific ABAP program?
    Thanks.

    Hi,
    Check the table starting with TVAR*.
    Regards,
    Atish

  • How do I get Mozilla to use the page name for the actual bookmark name instead of the URL when I bookmark a page

    I just noticed this (in comparison to Internet Explorer): In IE, when you favorite a webpage, it uses the actual name of the webpage (for example, for this page, it would be "Ask a Question Firefox Help" as the bookmark name), but in Mozilla it uses the URL address as the bookmark name. I was wondering if it was at all possible to change my Mozilla settings in order to make it use the webpage name as the bookmark name instead of the URL address? I hope everyone understands what I'm getting at? If anyone can help me, I would really appreciate it. Thanks.

    Does this happen with each bookmark?
    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes
    Problems with bookmarks and history not working properly can be caused by a corrupted places.sqlite database file.
    *http://kb.mozillazine.org/Bookmarks_history_and_toolbar_buttons_not_working_-_Firefox
    *https://support.mozilla.org/kb/Bookmarks+not+saved#w_fix-the-bookmarks-file
    You can try to check and repair the places database with this extension:
    *https://addons.mozilla.org/firefox/addon/places-maintenance/

  • For some artists in my Music app on my I-phone, the songs do not appear when I search by the artist.  However, if I search the album name, all the songs show.  How do I get the songs to show under songs?

    For some artists in my Music app on my I-phone, the songs do not appear when I search by the artist.  However, if I search the album name, all the songs show.  How do I get the songs to show under songs?

    Hi Spam_Valley,
    I understand that you are having issues with your music displaying correctly. This may be an issues with the metadata stored within that song, and iTunes interpretation of that info.
    We may need to repair this. See the following resources for information:
    iTunes 10 for Windows: If song titles don’t appear correctly
    http://support.apple.com/kb/PH1468
    Fixing Incorrect Song or Album Listings in iTunes
    http://support.apple.com/kb/TA24677
    Thanks,
    Matt M.

  • How to find the query name when we know the program name? Urgent!!!!!

    The same as the title, thanks in advance!
    For example, the program for the query is:AQZZZSAPQUERY===ZPAYMENT_MEDIA.

    Hi ,
    I think you have not given the correct name of the program .
    normally it will be AQZZ/SAPQUERY/ABZPAYMENT_MEDIA====
    Take the characters from the end i.e. before '=' sign and search in SQ01 to get the query name.
    for your example, Query name may be ZPAYMETN_MEDIA itself.
    Hope it helps you.
    Kind Regards,
    Ravi Sankar.Z

  • When i burn a playlist to CD, how to get the track names on the CD?

    When i burn a playlist to a CD, the tracks are all there and play just fine.  But when i look at the track names on the CD, they're just "Track 1", "Track 2" etc.  the tracks on the playlist itself are all named with fulll information.  How can i burn the CD so the track info will be included?

    Try changing the Disc format to Audio CD in iTunes preferences.
    If you burn it as a data CD, it will only be playable on computers (and a small number of other players).

  • How to get selection screen variant name of a report ?

    Hi Experts,
    Can any body please suggest, how I can get the variant name that was selected when a report program was being scheduled in background?
    I am using system field SY-SLSET but it is working only at foregrounf execution.In background mode it holds different value like '&0000000000038'.
    Thanks in advance.

    Hi !
    When running the program in foreground (SE38 -> F8) or in a background job (SM36), sy-slrel is correctly filled.
    When running in background via SE38 transaction (run in background  : F9), sy-slrel is not filled correctly (&000010 for example).
    However, in the second case, you still are in foreground when in the selection screen. Thus this simple but quite efficient idea of  [Vinod Vemuru|http://wiki.sdn.sap.com/wiki/display/~ncz6anw] :
    http://wiki.sdn.sap.com/wiki/display/ABAP/Howtogetthevariantnamewhenrunningthereportinbackgroundfromselectionscreen

  • How to get the Useru2019s position when the user doesnu2019t have CP relation

    We have a custom program which will add / delete attributes (In transaction PPOSA_BBP). It is working fine for users which were assigned with CP relation But it fails for users which doesnu2019t have CP relation (since we are getting the position of users form HRP1001 then we are retrieving the existing attributes based on the position after that updating the attributes) as we are getting the position from HRP1001 it fails for users were no CP relation.
    Help us how to get the Useru2019s position when the user doesnu2019t have CP relation. Suggest us any function module or how to query the HRP1001 or some other table if exists
    Regards
    Paul

    Hi Paul,
    Have a look at these tables.
    Using table BUT000 the central business partner data are stored, f.e. partner type, partner names, partner number, partner guid, person number, etc. In table BUTBKK the bank data to a business partner are stored.
    Central business partner address data
    The table ADRC is used for the address of a business partner. Table BUT020 links the business partner number with the address number. Using table BUT021 several addresses to a business partner with different usages (modes), f.e. correspondence or delivery address, can be stored. The personal data of a business partner person are stored with key person number in table ADRP. The person number is assignd to a business partner person in table BUT000. Communication data of business partners as e-mail, telephone, fax, etc. are stored in the tables ADDR1 u2013 ADDR12. The business address of a contact person or an employee consists of the organization address (company resp. org.-unit) and of an address addition, which describes f.e. a building, a room number, etc. The address addition is stored in table ADCP and is identified by the keys address number of the organization address and person number.
    Relationships between business partners
    Table BUT050 contains the relationships between a business partner organization and a business partner person using relation types. The relation types are defined in table TBZ9, f.e. the relation type u2018has employeeu2019 corresponds to identifier u2018BUR010u2019, the relation type u2018has contact personu2019 corresponds to identifier u2018BUR001u2019. Table BUT051 stores communication data of a contact person relationship (compare to table ADCP). Table BUT052 stores several address numbers to one business partner relationship (including a standard flag).
    Hope this helps,
    Kind Regards,
    Matthew

  • How to get the column names of the table into the Dashboard prompt

    how to get the column names of the table into the Dashboard prompt
    Thanks & Regards
    Kishore P

    Hey john,
    My requirement is as follows
    I have created a Rank for Total sales by Region wise i.e RANK(SUM(Dollars By Region)) in a pivot table.
    My pivot table looks like this
    COLUMN SELECTOR: TOTAL US , REGION , DISTRICT , MARKET
    ---------------------------------------------------- JAN 2009          FEB 2009        MAR 2009
    RANK              REGION                  DOLLARS           DOLLARS        DOLLARS DOLLARS
    1 CENTRAL 10 20 30 40
    2 SOUTHERN 10 30 30 70
    3 EASTERN 20 20 20 60
    4 WESTERN 10 20 30 40
    When i select the District in column selector
    Report has to display rank based on Total Sales by District. i.e
    ------------------------------------------------- JAN 2009         FEB 2009       MAR 2009
    RANK             DISTRICT              DOLLARS           DOLLARS        DOLLARS DOLLARS
    for this i need to change the fx of rank i.e RANK(SUM(Dollars By Region)) to RANK(SUM(Dollars By District)) and fx of Region i.e Markets.Region to Markets.District dynamically.
    so , i need to capture column name of the value selected from the column selector and dynamically i need to update the fx 0f RANK & fx of region.
    do you have any solution for this?
    http://rapidshare.com/files/402337112/Presentation1.jpg.html
    Thanks & Regards
    Edited by: Kishore P on Jun 24, 2010 7:24 PM
    Edited by: Kishore P on Jun 24, 2010 7:28 PM

  • To make the variant default when launching transaction VT01N

    My SAP is ECC6, I created a variant by following the procedure below:
    1. Go to transaction SE38.
    2. Enter program 'SAPLV56L', then select 'Variants' and click 'Change'.
    3. In the Variant field, enter the variant name you will be using, then press Create.
    4. Click the 'Attributes' button.
    5. In the 'Delivery Date' line. Select the 'D' type of variable in the 'Selection variable' column.
    6. Then select value in the 'Name of Variable' column, in the 'Current date' variable enter 'I' in 'I/E' column and 'EQ' in 'Option' column and press enter.
    7. Write a short text in the Meaning field and save the variant.
    8. Check the variant in transaction 'VT01N' and it must have the current date as the default date.
    My question is how can I make the variant that I created to default in transaction VT01N?
    Is this possible to setup in transaction SU3? If yes, how?
    Or in transaction SHD0?
    Thanks in advance for your replies.

    Hi,
    You can make it default by parameter ID
    Go to transaction code SU01
    Enter user ID and click on change icon
    Go to parameters tab
    Enter *parameter ID as TSV  and enter parameter value as your created variant* XYZ
    Save
    Now when you run VT01N this variant will appear as default variant
    Kapil

Maybe you are looking for

  • Get error msg: A copy of Firefox is already open. Only one copy of Firefox can be open at a time.

    Get the following msg. when I try to open Firefox: " Close Firefox. A copy of Firefox is already open. Only one copy of Firefox can be open at a time." No other copy is installed or running. == This happened == Every time Firefox opened == After I re

  • Cannot download apex

    I tried download link for Oracle Application Express (Apex) and got nothing, empty page was loaded. The link I tried: http://www.oracle.com/technology/products/database/application_express/download.html Is something wrong on server side? Thanks Rusla

  • How to find & delete all associated files of a hyper-V VM?

    I've spent a day searching, what I thought was a simple question. How do you find and delete all the associated files of a Hyper-V VM? In this case, someone left several VMs used for training. For example there is a VM of Server 2008 named Boston. Ho

  • Videos no longer streaming

    Something changed and I don't know what. For some reason, I suddenly can't watch mp4 videos as they download. I checked my Options | Applications for MP4 files and the default was changed to Quicktime (but I did not install or update anything from Ap

  • Loading screen painter form via a menu event.

    Hi, In my application, I am trying to get my screen painter form (.srf) to display through a menu event. The thing is when I click on the menu the first time it loads okay but when I close it and try to open it by clicking it again nothing happens. I