Conditional compiling in abap

Is it possible, to use "compiler directives" in ABAP (as known in other programming languages), especially "conditional compiling".
I would like this technique, for a conditional compiling in following situation:
DDIC-TABLE M_VMVD ist available up to R/3-Release 4.6C
Since Release 4.70 this table is replaced by SHP_VIEW_EXVE.
If possible, i want to write <u>one</u> coding for both releases.
It is not sufficient to use a "normal" if - command, because syntax-check will detect an error (table xy is not known).
Here a - fictional - example, what i think about:
*# IF_COMPILER_RELEASE <  470.  (fictional Compiler-Directive)
select single vbeln into my_vbeln from m_vmvmd where lifex = my_lifex.
*# ELSE_COMPILER_DIRECTIVE (fictional)
select single vbeln into my_vbeln from shp_view_exve where lifex = my_lifex.
*# ENDIF_COMPILER_DIRECTIVE  (fictional)
I know, that there was a conditional-compiling-technique for differing R/2 and R/3.
It was something like that:
*#R2    write: / 'Compiled with R/2'.
*#R3   write: / 'Compiled with R/3'.
Best Regards
Juergen

Hi jurgen,
1. compiler directives are not supported in abap r/3,
  in the way, they are used in c and c++.
2. However,
3. For your requirement, we can use
    select with dynamic table name,
   and an if condition.
4. To get a taste of it, just copy paste.
5.
REPORT abc.
data : bukrs like t001-bukrs.
data : tabname(30) type c.
tabname = 'T001'.
CONDITIONAL , NORMAL IF
IF REL < 470.
tabname = 'XYZT001'.
ENDIF.
select single bukrs
from (tabname)
into bukrs.
WRITE :/ BUKRS.
regards,
amit m.

Similar Messages

  • Conditional Compilation (or something like this!)

    Hi all.
    In my application I would need to conditionally import a jar, depending on a configuration switch.
    I'm attaching here some sample code (written in "c++ conditional compilation mode") to explain better the situation:
    #ifdef (VERSION_5)
    path.to.mypackage.MyClass mc = new path.to.mypackage.MyClass();
    mc.doSomething();
    #endifWhat I need is not to be forced to include the package "path.to.mypackage" at compile-time if the version is not VERSION_5.
    Any help will be very appreciated!!

    I chose this way: provided that there's only one class in which I have to use the path.to.mypackageMyClass class, I load this class (runtime if conditioned) through reflection.
    So, the compiler doesn't require to see that package, that eventually gets loaded runtime.

  • How to find the start condition of a ABAP program?

    Hello Gurus!,
    Could any one please explain how to find the start condition of a ABAP program?
    like its a event based or time based?and also how to find that event and time..
    Thanks in Advance...
    Dinakar

    Hi Dinkar,
    Go to Job Schedule, put Job Step parameter as your program and see scheduled Job.
    In Schedule Job double click to see start condition. and steps to see details and variant.
    Hope it helps.
    Thanks
    CK

  • Flash Builder 4.7 conditional compiling failed

    I installed Flash Builder 4.7 on my windows xp machine, and tried to migrate projects from FB 4.6. However in one of my projects I use conditional compiling, but I'm getting errors.For example in FB 4.6 I have this sample code:
    public class MyClass{
         CONFIG::DEBUGGING{
              import com.package.SomeClassOnlyForDebugging
         function someFunction():void{
              if (CONFIG::DEBUGGING){
                   SomeClassOnlyForDebugging.create();
    When I compiled it in FB 4.6 everything worked fine. However when I try to compile it in FB 4.7, then I get error on the conditional compiling only inside the function and not on the import statement. The only way I have found to overpass it is to go to Project>Properties>ActionScript Compiler and disable Enable strict type checking. But this is not a permanent solution.
    Am I doing something wrong, or is there some other way to do it?

    You should to do like that:
    function someFunction():void
    CONFIG::DEBUGGING {
         SomeClassOnlyForDebugging.create();
    without if.

  • Conditional compilation and import statements

    I have a web application written in Flex and I'm trying  to build an AIR application from the same code base using conditional  compilation.
    In the AIR application, I need to have import statements  such as the following:
    import flash.data.SQLConnection;
    import  flash.filesystem.File;
    but I cannot have these import statements in the web  application because they are AIR only classes.
    I thought I could use conditional compilation to  overcome this issue but then I read the following on page http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7abd.html:
    "You cannot use constant Boolean values to conditionalize metadata or import statements."
    If that's the case, how can I have common codebase for Flex based web as well as desktop applications? Has anyone solved this conundrum?
    Thanks,
    Dilip

    DilipShah, as far as I see the classes are still included if referenced by import.
    Example:
    I have this statement in my class A
    if(CONFIG::platform == "ios") {
                        import B;
    I can see in linkreport that class B is still included and is included because A is referencing it.
    Flex harUI, classes are included into final swf file if any other class is referencing it through import even though not using it. I've experimented with it quiet a bit.

  • [svn] 2716: SDK-15848 - Conditional compilation constants defined in flex-config. xml are never used if a single constant is specified on the command line

    Revision: 2716
    Author: [email protected]
    Date: 2008-08-04 01:18:12 -0700 (Mon, 04 Aug 2008)
    Log Message:
    SDK-15848 - Conditional compilation constants defined in flex-config.xml are never used if a single constant is specified on the command line
    * There's a possibility this will break a conditional complication test which disallows overwriting an existing definition -- I don't know if that will break the build, but the test should be removed either way.
    * Using append syntax ("-define+=" on the command line or ant tasks, or append="true" in flex-config) and redefining a value works now if you use an already-defined namespace and name.
    * So your flex-config may have -define=CONFIG::debug,false, and you may want -define+=CONFIG::debug,true from the commandline build, or FB build.
    * Made the ASC ConfigVar fields final as a sanity check since overwriting is now allowed. It would be harder to track changes and subtle bugs if they were mutable. This means that you must build a new ConfigVar object if you need to make changes.
    Bugs: SDK-15848
    QA: Yes. Please read the updated javadocs in CompilerConfiguration. Tests need to be added to validate that overwriting is allowed, and happens correctly in different situations: I believe the order should be that flex-config is overwritten by a custom config (can we have more than one user config? is the order deterministic? I forget...), is overwritten by commandline or OEM. Did I miss any? (I didn't write code which changes this, it works however the existing configuration system allows overwriting and appending; if we have tests for that, maybe we don't need them duplicated for this feature.)
    Doc: Yes. Please read the updated javadocs in CompilerConfiguration.
    Reviewer: Pete
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-15848
    http://bugs.adobe.com/jira/browse/SDK-15848
    Modified Paths:
    flex/sdk/trunk/modules/asc/src/java/macromedia/asc/embedding/ConfigVar.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/common/CompilerConfiguration.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/tools/oem/internal/OEMConfiguration.java

    Please note: I AM USING:
    JkOptions ForwardKeySize ForwardURICompat -ForwardDirectories
    And that's what's supposed to fix this problem in the first place, right??

  • Conditional compile code for debug v.s. release

    Hi,
    Is there a pre-defined symbol (e.g., DEBUG, DEBUG) for conditional compile section of code for debug v.s. release?
    Thanks for your reply in advance!

    Take a look at TargetConditionals.h, I use TARGETIPHONESIMULATOR a lot.

  • [svn] 4836: Fix problems with asdoc comments and conditionally compiled definitions.

    Revision: 4836
    Author: [email protected]
    Date: 2009-02-04 11:07:52 -0800 (Wed, 04 Feb 2009)
    Log Message:
    Fix problems with asdoc comments and conditionally compiled definitions. Fixes bug http://bugs.adobe.com/jira/browse/ASC-3649
    Ticket Links:
    http://bugs.adobe.com/jira/browse/ASC-3649
    Modified Paths:
    flex/sdk/trunk/modules/asc/src/java/macromedia/asc/embedding/Compiler.java
    flex/sdk/trunk/modules/asc/src/java/macromedia/asc/semantics/ConfigurationEvaluator.java

    In the default php.ini is set open_basedir which limits work with php only to few directories (and directories bellow them). There is set /srv/http, /home,/tmp and /usr/share/pear by default.
    To allow your vhost you should add /data/www or set empty value.

  • Why the sap will compile the abap program again and again?

    Every one tell me that when you open some screen at the first time, the sap will compile the abap program and will not compile again at the next time.But I found actually when I open some screen at the 2th or 3th or more times,the sap will still compile the abap again.Such as open the T-CODE va01,mm01,and so on,the sap will show some message below the screen to show it was compiling the abap program.This make the operation spend me huge time.Is there any one could tell me how to resolve the problem or give me some advice?And I will appreciate him/her very much.Thank you.

    Hi..
    It has very simple answer ... SAP code resides in database and it doesnt deliver a exe or a dll files (obj) to customer ..Now when program initially is loaded it is compiled and its linked object file is stored in SAP memory and therefore it is not compiled next time...
    Regards
    Anuj Goyal

  • How to create the condition record by ABAP program

    Hi Friends,
    I want to create/change the condition record of PR00 by ABAP program. It seems that there have no such BAPI/standard function can help on this. Can any one of you point out a way to me?? Thanks in addvance.
    Joe GR.

    Joe,
      Check with below FM..
    BAPI_PRICES_CONDITIONS.
    Check this link:
    Re: Sample code for  BAPI_PRICES_CONDITIONS
    examples....
    http://www.4ap.de/abap/bapi_prices_conditions.php
    Two useful threads on Same topic
    Re: Sample code for  BAPI_PRICES_CONDITIONS
    Re: Problem with BAPI_PRICES_CONDITIONS
    BAPI_PRICES_CONDITIONS
    Please check this sample code from other thread.
    wtable1-table_no = '306'.
    wtable1-applicatio = 'V'.
    wtable1-cond_type = 'ZPR0'.
    wtable1-operation = '009'.
    wtable1-varkey = '13001001USD 000000000050068946'.
    wtable1-valid_to = '99991231'.
    wtable1-valid_from = '20051101'.
    wtable1-cond_no = '$000000001'.
    APPEND wtable1 TO table1.
    wtable2-operation = '009'.
    wtable2-cond_no = '$000000001'.
    wtable2-created_by = sy-uname.
    wtable2-creat_date = '20051022'.
    wtable2-cond_usage = 'A'.
    wtable2-table_no = '110'.
    wtable2-applicatio = 'V'.
    wtable2-cond_type = 'ZPR0'.
    wtable2-varkey = '13001001USD 000000000050068946'.
    wtable2-valid_from = '20051101'.
    wtable2-valid_to = '99991231'.
    APPEND wtable2 TO table2.
    wtable3-operation = '009'.
    wtable3-cond_no = '$000000001'.
    wtable3-cond_count = '01'.
    wtable3-applicatio = 'V'.
    wtable3-cond_type = 'ZPR0'.
    wtable3-scaletype = 'A'.
    wtable3-scalebasin = 'C'.
    wtable3-scale_qty = '1'.
    wtable3-cond_p_unt = '1'.
    wtable3-cond_unit = 'EA'.
    wtable3-calctypcon = 'C'.
    wtable3-cond_value = '454'.
    wtable3-condcurr = 'USD'.
    APPEND wtable3 TO table3.
    CALL FUNCTION 'BAPI_PRICES_CONDITIONS'
    EXPORTING
    PI_initialmode = 'X'
    PI_BLOCKNUMBER =
    TABLES
    ti_bapicondct = table1
    ti_bapicondhd = table2
    ti_bapicondit = table3
    ti_bapicondqs = table4
    ti_bapicondvs = table5
    to_bapiret2 = table6
    to_bapiknumhs = table7
    to_mem_initial = table8
    EXCEPTIONS
    update_error = 1
    OTHERS = 2
    IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    READ TABLE table6 WITH KEY type = 'E' TRANSPORTING NO FIELDS.
    IF sy-subrc = 0.
    loop at table6 into ret.
    write: / ret-type, ret-message, ret-id, RET-LOG_NO, RET-LOG_MSG_NO,
    RET-MESSAGE_V1, RET-MESSAGE_V2, RET-MESSAGE_V3, RET-MESSAGE_V4,
    RET-PARAMETER,RET-ROW,RET-FIELD.
    endloop.
    ELSE.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    *EXPORTING
    WAIT =
    IMPORTING
    return = ret
    ENDIF.
    Don't forget to reward if useful....

  • ASC 2.0 Preview 2 Bug - Conditional Compilation around a constructor fails

    Is this the right place to be reporting bugs?
    Source class:
    public class Something
    CONFIG::debug
    public function Something(id:uint)
    CONFIG::release
    public function Something()
    In another class:
    CONFIG::debug
    var q:Something = new Something(10);
    Compiling with Additional Compiler Arguments set to "-define+=CONFIG::debug,true -define+=CONFIG::release,false" results in the following warnings and errors:
        [mxmlc] Warning: return value for function 'Something' has no type declaration.
        [mxmlc]                               public function Something(id:uint)
        [mxmlc]                                               ^
        [mxmlc] Error: Incorrect number of arguments.  Expected no more than 0
        [mxmlc]                                         var q:Something = new Something(10);
        [mxmlc]                                                           ^

    I could reproduce this issue with ASC 2. I've logged this as bug 3339009.
    I'm guessing you have a more complex scenario in mind, but the workaround for this simple case might be to use default arguments to make the constructor parameter optional?
            public function Something(id:uint=0)
    The bug does seem to impact constructors. Another workaround for now is to use a conditional factory pattern?
    package
    public class Something
        public function Something(id:uint=0)
            this.id = id;
          private var id:uint;
        CONFIG::debug {
            public static function createInstance(id:uint):Something
                return new Something(id);
       CONFIG::release {
            public static function createInstance():Something
                return new Something();

  • CL_RECD_CONDITION / retrieve condition amount in ABAP

    Hi All,
    New on RE-FX, I am in  charge of developping a report for RE-FX, returning in particular the conditions amounts.
    I need yearly amounts for each contracts, knowing that contracts have several conditions.
    APIs and BAPIs dont provide calculated amounts. I found the class CL_RECD_CONDITION, and I would like to use one of these methods (i guess at least one will provide req. info):
    - IF_RECD_CONDITION~GET_CALC_VALUES
    -IF_RECD_CONDITION~GET_STANDARD_VALUES
    Unfortunately, I'm not able to call these methods in the abap, I always have this error message:
    "You cannot create an instance of the class "CL_RECD_CONDITION" within
    the class itself or one of its subclasses."
    my code is as following:
        DATA lr_cond TYPE REF TO cl_recd_condition.
        CREATE OBJECT lr_cond.
        CALL METHOD lr_cond->if_recd_condition~get_standard_values
       CALL METHOD if_recd_condition->get_standard_values
          EXPORTING
            id_keydate        = w_keydate
       if_distribution   = ABAP_FALSE
            id_distobjnr      = wa_vicncn-objnr
          IMPORTING
       ed_condvalueday   =
       ed_condvalueweek  =
       ed_condvaluemonth =
            ed_condvalueyear  = w_recdcondvalueyear
       ed_taxvalueday    =
       ed_taxvalueweek   =
       ed_taxvaluemonth  =
       ed_taxvalueyear   =
       ed_calcvalue      =
       ed_distvalue      =
       ed_taxvalue       =.
    Many thanks for your help if you have informations on the correct way to get these conditions' amounts!
    Cheers
    Oli

    Hi Oli,
    you just have first to create contract and condition manager to call afterwards methods for conditions.
    Here a sample coding:
    go_contract       TYPE REF TO if_recn_contract,
    go_condition_mngr TYPE REF TO if_recd_condition_mngr,
    gto_cond          TYPE re_t_if_recd_condition,
    go_condition_mngr TYPE REF TO if_recd_condition_mngr,
    go_cond          TYPE REF TO if_recd_condition.
    1. Find contract
         CALL METHOD cf_recn_contract=>find
            EXPORTING
              id_bukrs      = p_bukrs
              id_recnnr     = p_recnnr
              id_activity   = gd_activity
              if_auth_check = abap_true
              if_enqueue    = abap_true
            RECEIVING
              ro_instance   = go_contract
            EXCEPTIONS
              error         = 1
              OTHERS        = 2.
    2. Get condition manager
        go_condition_mngr = go_contract->get_condition_mngr( ).
    3. Get condition objects
    get cond list
      CALL METHOD go_cond_mngr->get_list
        EXPORTING
          if_incl_booking_context = abap_false
          if_incl_booking_min_max = abap_false
          if_incl_lock_context    = abap_false
        IMPORTING
          eto_condition           = gto_cond.
    4. Loop at conditions and call method
    LOOP AT gto_cond INTO go_cond.
      get standard values
        CALL METHOD go_cond->get_standard_values
          EXPORTING
            id_keydate        = id_keydate
          IMPORTING
            ed_condvalueday   = ld_condvalueday
            ed_condvalueweek  = ld_condvalueweek
            ed_condvaluemonth = ld_condvaluemonth
            ed_condvalueyear  = ld_condvalueyear
            ed_taxvalueday    = ld_taxvalueday
            ed_taxvalueweek   = ld_taxvalueweek
            ed_taxvaluemonth  = ld_taxvaluemonth
            ed_taxvalueyear   = ld_taxvalueyear.
    ENDLOOP.
    Hope that helps.
    Regards, Franz

  • IF condition to execute ABAP code; VBAK-VSBED; VBPA-KUNNR; XVBPA/YVBPA

    Hi All!
    I need some help. I have to change the MV45AFZZ, the FORM USEREXIT_MOVE_FIELD_TO_VBAK. The user exit should write the VBAK-VSBED (shipping condition) from the KNVV-VSBED for the VBPA-KUNNR, PARVW=WE (the ship-to-party partner). The user exit should also permit the modification of VBAK-VSBED directly from VA01 or VA02 (even if the ship-to-party remain the same).
    I write down the ABAP code but I need to write a condition in order to execute the modification of VBAK-VSBED:
    1. in VA01, for the first time;
    2. in VA01 and VA02 if I change the ship-to-party partner.
    Now, if I want to change VBAK-VSBED without modifying the ship-to-party, I can not. The user exit overwrite the VBAK-VSBED for the ship-to-party.
    The code is:
    READ TABLE xvbpa WITH KEY parvw = 'WE' .
    IF SY-SUBRC = 0.
      SELECT SINGLE * FROM knvv WHERE kunnr EQ xvbpa-kunnr and
                                      vkorg EQ xvbak-vkorg and
                                      vtweg EQ xvbak-vtweg and
                                      spart EQ xvbak-spart .
      vbak-vsbed  = knvv-vsbed.
    ENDIF.
    Any help will be appreciate.
    Florina C.

    Hi,
    try this example:
    *Table YVBPA should always be filled, when executing VA02, but if it is not, you
    *can simple select the Sales Partner from VBPA(in va02 scenario it would be in *DB aldready)
    if sy-tcode = 'VA01'.
      READ TABLE xvbpa WITH KEY parvw = 'WE' .
      IF SY-SUBRC = 0.
        SELECT SINGLE * FROM knvv
        WHERE kunnr EQ xvbpa-kunnr  and
           vkorg EQ xvbak-vkorg and
           vtweg EQ xvbak-vtweg and
           spart EQ xvbak-spart .
           vbak-vsbed = knvv-vsbed.
      ENDIF.
    else if tcode = 'VA02'.
      if YVBPA[] is initial.
          select single * from vbpa
          where vbeln = vbak-vbeln and parvw = 'WE'.
          if sy-subrc = 0.
                 partner_before_change = vbpa-kunnr.
          endif.
      else.
          READ TABLE yvbpa WITH KEY parvw = 'WE' .
          if sy-subrc = 0.
             partner_before_change = yvbpa-kunnr.
          endif.
      endif.
      READ TABLE xvbpa WITH KEY parvw = 'WE' .
      IF SY-SUBRC = 0 and
         xvbpa-kunnr <> partner_before_change.
         SELECT SINGLE * FROM knvv
         WHERE kunnr EQ xvbpa-kunnr and
               vkorg EQ xvbak-vkorg and
               vtweg EQ xvbak-vtweg and
               spart EQ xvbak-spart .
         vbak-vsbed = knvv-vsbed.
       endif.
    endif.
    Best Regards,

  • Exception condition "CNTL_ERROR WD-abap Smartform to pdf

    Hii, 
    I am using a webdynpro - abap application. I am showing  a smartform as a pdf in one on the windows.
    When the link in the main window is clicked, a secondary window. Instead of the pdf, I get following exception.Kindly help me understand, where would I be going wrong. Let me know if more details required.
    **Exception condition "CNTL_ERROR" raised. **
    Form: PBO_HTML_CONTROL of program SAPLSTXBC
    Module: HTML_CONTROL of program SAPLSTXBC
    Function: SSFCOMP_PDF_PREVIEW of program SAPLSTXBC
    Method: DISPLAYPDF of program /1BCWDY/2TKFRFPNZA4CZYBGEB8F==CP
    Method: IF_COMPONENTCONTROLLER~DISPLAYPDF of program /1BCWDY/2TKFRFPNZA4CZYBGEB8F==CP
    Method: ONACTIONPDF of program /1BCWDY/2TKFRFPNZA4CZYBGEB8F==CP
    Method: IF_WDR_VIEW_DELEGATE~WD_INVOKE_EVENT_HANDLER of program /1BCWDY/2TKFRFPNZA4CZYBGEB8F==CP
    Method: INVOKE_EVENTHANDLER of program CL_WDR_DELEGATING_VIEW========CP
    Method: IF_WDR_ACTION~FIRE of program CL_WDR_ACTION=================CP
    Method: DO_HANDLE_ACTION_EVENT of program CL_WDR_WINDOW_PHASE_MODEL=====CP
    The code in the DISPLAYPDF method is as follows:
    method DISPLAYPDF .
    DATA: I_RS38L_FNAM TYPE  RS38L_FNAM.
    DATA: CTRL TYPE SSFCTRLOP.
    DATA: OUT TYPE  SSFCOMPOP.
    DATA: I_SSFCRESCL TYPE SSFCRESCL.
    DATA: LT_OTFDATA TYPE TABLE OF ITCOO.
    CTRL-GETOTF = 'X'.
    CTRL-NO_DIALOG = 'X'.
    CTRL-PREVIEW = 'X'.
    OUT-TDNEWID = 'X'.
    OUT-TDDELETE = ' '.
    data: i_tsp03 type tsp03.
    clear i_tsp03.
    select single * from tsp03 into i_tsp03.
    *OUT-TDDEST = i_tsp03-PADEST.
    OUT-TDDEST = 'TEP1'.
    ********get context data
      DATA lo_nd_zwebquestionaire TYPE REF TO if_wd_context_node.
      DATA lo_el_zwebquestionaire TYPE REF TO if_wd_context_element.
      DATA ls_zwebquestionaire TYPE wd_this->element_zwebquestionaire.
    * navigate from <CONTEXT> to <ZWEBQUESTIONAIRE> via lead selection
      lo_nd_zwebquestionaire = wd_context->get_child_node( name = wd_this->wdctx_zwebquestionaire ).
    * get element via lead selection
      lo_el_zwebquestionaire = lo_nd_zwebquestionaire->get_element(  ).
    * get all declared attributes
      lo_el_zwebquestionaire->get_static_attributes(
        IMPORTING
          static_attributes = ls_zwebquestionaire ).
    ********get context data ends
    data: itab1 type TCHAR255.
    data: itab2 type TCHAR255.
    data: itab type zprint. "addition by chandani
    data fm_name type rs38l_fnam..
    clear fm_name.
    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
      EXPORTING
        FORMNAME             = 'ZCPESMARTFORM'
      IMPORTING
        FM_NAME              = fm_name
      EXCEPTIONS
        NO_FORM              = 1
        NO_FUNCTION_MODULE   = 2
        OTHERS               = 3.
    CALL FUNCTION fm_name
    EXPORTING
    *   ARCHIVE_INDEX              =
    *   ARCHIVE_INDEX_TAB          =
    *   ARCHIVE_PARAMETERS         =
       CONTROL_PARAMETERS         = CTRL
    *   MAIL_APPL_OBJ              =
    *   MAIL_RECIPIENT             =
    *   MAIL_SENDER                =
       OUTPUT_OPTIONS             = OUT
       USER_SETTINGS              = ' '
       NAME                       = 'test'
       ZWEBQUESTIONAIRE           = ls_ZWEBQUESTIONAIRE
    IMPORTING
    *   DOCUMENT_OUTPUT_INFO       =
       JOB_OUTPUT_INFO            = I_SSFCRESCL
    *   JOB_OUTPUT_OPTIONS         =
    TABLES                                  "addition by chandani
      itab                         = itab   "addition by chandani
    * EXCEPTIONS
    *   FORMATTING_ERROR           = 1
    *   INTERNAL_ERROR             = 2
    *   SEND_ERROR                 = 3
    *   USER_CANCELED              = 4
    *   OTHERS                     = 5
    IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    REFRESH LT_OTFDATA.
    LT_OTFDATA[] = I_SSFCRESCL-OTFDATA[].
    CALL FUNCTION 'SSFCOMP_PDF_PREVIEW'
      EXPORTING
        I_OTF                          = LT_OTFDATA
    * EXCEPTIONS
    *   CONVERT_OTF_TO_PDF_ERROR       = 1
    *   CNTL_ERROR                     = 2
    *   OTHERS                         = 3
    IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    DATA: PDF_DATA TYPE XSTRING,
          PDF_SIZE TYPE I.
    DATA: L_DUMMY TYPE STANDARD TABLE OF TLINE.
    CALL FUNCTION 'CONVERT_OTF'
    EXPORTING
       FORMAT                      = 'PDF'
    *   MAX_LINEWIDTH               = 132
    *   ARCHIVE_INDEX               = ' '
    *   COPYNUMBER                  = 0
    *   ASCII_BIDI_VIS2LOG          = ' '
    *   PDF_DELETE_OTFTAB           = ' '
    IMPORTING
       BIN_FILESIZE                = PDF_SIZE
       BIN_FILE                    = PDF_DATA
      TABLES
        OTF                         = LT_OTFDATA
        LINES                       = L_DUMMY
    * EXCEPTIONS
    *   ERR_MAX_LINEWIDTH           = 1
    *   ERR_FORMAT                  = 2
    *   ERR_CONV_NOT_POSSIBLE       = 3
    *   ERR_BAD_OTF                 = 4
    *   OTHERS                      = 5
    IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
      DATA lo_nd_pdf TYPE REF TO if_wd_context_node.
      DATA lo_el_pdf TYPE REF TO if_wd_context_element.
      DATA ls_pdf TYPE wd_this->element_pdf.
      DATA lv_sources LIKE ls_pdf-sources.
    * navigate from <CONTEXT> to <PDF> via lead selection
      lo_nd_pdf = wd_context->get_child_node( name = wd_this->wdctx_pdf ).
    * get element via lead selection
      lo_el_pdf = lo_nd_pdf->get_element(  ).
    * get single attribute
      lo_el_pdf->Set_attribute(
        EXPORTING
          name =  `SOURCES`
          value = PDF_DATA ).
    endmethod.

    Use -  with gui_download
    call method cl_gui_frontend_services=>environment_get_variable
    exporting
    variable = p_envir_name
    changing
    value = ls_envir_path
    exceptions
    cntl_error = 1
    error_no_gui = 2
    others = 3.
    call method cl_gui_cfw=>flush
    exceptions
    cntl_system_error = 1
    cntl_error = 2
    others = 3.
    And refer the below notes: 972762
    ITS 620 Patch 23 and SAPKB62061
    ITS 640 Kernel Patch 148 and SAPKB64019
    ITS 700 Kernel Patch 77 and SAPKB70010
    and also refer the link below to get more info
    http://www.sapfans.com/forums/viewtopic.php?f=13&t=325628&start=15
    thanx
    suriya

  • Is there a way to conditionally compile for AS2.0 or AS3.0?

    I'm moving some projects with .as files to AS3.0, but I would
    like to maintain backwards compatibility with AS 2.0.
    One example is in AS 2.0, including files is:
    #include &quot;myFile.as&quot;
    In AS 3.0, this causes an error, and apparently it likes:
    include &quot;myFiles.as&quot;
    Is there some way to surround this with some code so that it
    can be compiled under either AS 2.0 or AS 3.0?

    no. include files are compiled at publication, not during
    run-time.

Maybe you are looking for

  • Error in writing to directory /tmp/OraInstall2007-08-27_12-58-31AM.

    hi. i am new to oracle installation. i set all parameters and environment values. when i entered runinstaller, i recieving this error message. [oracle@localhost Disk1]$ ./runInstaller Error in writing to directory /tmp/OraInstall2007-08-27_12-58-31AM

  • I have connected my new Onkyo TXNR626 to new Apple TV.  No Sound

    I have connected my new Onkyo TXNR626 to new Apple TV.  I am not using video.  AppTV connected to receiver via optical digital audio cable.  Onkyo remote controls AppleTV on my iMac.  Wireless set up and connected.  No audio coming from receiver.  Sp

  • Face Time not able to connect from MBAir with yosemite 10.10.2 to ipod 4th gen. 6.1.6

    Hi All I ressurrected my son's 4th gen Ipod and updated to 6.1.6 . It work perfectly . System 6.1.6 has face time and iMessage and the it works flawlessly from the ipod to my 2013 MB air with Yosemite 1010.2 and to the Ipad air2 with latest software

  • CRS with standard edition.

    Hi All, Need your help... We have a setup of RAC 10gR1 with enterprise edition 2 nodes on SUN solaris 5.9. How to setup RAC 10gR1 with STANDARD EDITION on the same 2 node without disturbing the current setup of enterprised EDITION. Any doc or any ide

  • Uploading retouched photos in photostream

     When I retouch my photos in snapseed and save them to my camera roll as a new photo they get uploaded in photostream. But they don't get uploaded after the last uploaded photo but in next to the original photo. Is there any way to change that?