Result parameter using ABAP OO

Hi
I'm working in a workflow project, based on ABAP OO instead of BOR.
I have created an ABAP OO method "Handling required", with a returning parameter, based on a data element/domain with two values "Handling Required" and "Handling Not Required".
Now it would like to "convert" these values to a result parameter, using the "add returned element" in the task container. This gives me the element WIRESULT, but somehow it won’t give me the two outcomes that I need.
Any suggestions / help on this?
Regards
Morten Nielsen

Hi Mike
Thanks for your very quick reply (This is exactly why the SDN is the greatest invention since snote and the wheel ).
Normally I'll prefer to keep my workflows as slim as possible, i order to simplify the workflow support/administration task, that is I prefer resultparameters to additional condition steps. But I guess we all have our own preferred approach.
But if ABAP OO doesn't support result parameters for workflow, a container element and a condition step will do the trick
Anyway Thanks for your input
Regards
Morten Nielsen

Similar Messages

  • How to use ABAP include in SLT parameter

    Hi Frzz,
    Could some one guide me how to use ABAP include in SLT parameter to perform calculations.
    Best Regards,
    Krishna.

    Hi,
    We can have ABAP includes within SLT advanced replicaiton settings.
    Go to IUUC_REPL_CONTENT select the applicable schema configuration name.click on "Select Configuration" button.
    you could see all the tables that are in replication.
    select the required table and then click on "edit settings for selected tables".
    in the next screen select "IUUC_***_RUL_MAP" tab . here we hve the option to insert line of code or abap include as per the requriement.
    please refer the techincal manual of SLT as well for more detailed information on advanced replicaitons within SLT.
    Thank you.
    Shishupal

  • How to use ABAP Class to modify Web Query Result ??

    Hi all !
    We are using Web Templates to display our Query.
    What I would like to do ( and seems a really important issue for our users! ) is to have a "PAGE BREAK" everytime the value of a charateristics change in the report
    For Example :
    -Page 1-
    Division     Project
       A               1
                        2
                        3
    -Page 2-
    Division     Project
       B               1
                        2
                        3
    and so on....
    I read threads about using ABAP CLASS but no example what so ever...
    We are presently under BW 3.1 but are considering upgrading to 7.0 by the end of the year so if there is a solution to my problem on either version i'd like to know.
    If anyone has any information about how I can do this it would be most appreciated
    Thx
    JB.

    Hi Yong,
    Ravi is right, first check the blogs by Jocelyn, and if you still have specific questions you can ask them. I have used ABAP classes in workflow and I know Mike Pokraka tries to use classes exclusively.
    Regards,
    Martin

  • Execute query with drill down using abap

    Hello together,
    I need to execute a query using abap and I need the result of the drill down on one characteristic in the query.
    I try to use RRX_GRID_CMD_PROCESS to execute query, but I don't understand how to do the drill down.
    I thought I have to specify somehow the name of the object on which I need to make the drill down. I tried to send this as a parameter to e_t_drill... but this is not working. I have also seen that
    e_t_drill[] = g_sx_buffer-r_request->n_sx_request-drill, but this is empty.
    Could you, please explain how to do this?
    Thank you,
    Iuliana

    Our RKF def is as follows:
    Keyfigure: 0deb_cre_lc
    Chars:
    Posting Keys: 01,02,11,12
    Year start date: Restricting it with a variable created on it. Variable is of type Customer exit.This variable
    gets value from key date which is entered by user dynamically.
    Specified the offsets of Yr start date as 0 to 365.
    Regards,
    smitha.

  • Execute BW query using ABAP

    Hello ,
    1) I used the function module from this link :
    /people/durairaj.athavanraja/blog/2005/12/05/execute-bw-query-using-abap-part-iii
    When I run it , I see the metadata correct and this is all. No more data to display.
    2) Then I used the code from here :
    /people/durairaj.athavanraja/blog/2005/12/05/execute-bw-query-using-abap-part-iii
    MOVE: <variable name> TO wa_var-vnam ,
       'I' TO wa_var-sign,
       'EQ' TO wa_var-opt,
       <variable value> TO wa_var-low .
         query_variables       = var
    FUNCTION z_test_query.
      FIELD-SYMBOLS: <outtab> TYPE ANY TABLE,
        <l_line>  TYPE ANY,
        <l_field> TYPE ANY.
      TYPE-POOLS: rrx1 .
      DATA: wa_var     TYPE     rrx_var ,
            var TYPE STANDARD TABLE OF rrx_var ,
            xml_out TYPE string ,
            breturn TYPE STANDARD TABLE OF bapiret2 ,
            rpt_tech_id(50) ,
            wa_meta TYPE zbw_query_output_metadata ,
            xslt_error TYPE REF TO cx_xslt_exception ,
            is_fieldcat     TYPE     lvc_s_fcat,
            it_fieldcat       TYPE     lvc_t_fcat,
            new_table  TYPE REF TO data ,
            xslt_message TYPE string ,
            meta TYPE STANDARD TABLE OF zbw_query_output_metadata . " this structure was created in the previous part
    *fill all the variables like below.
      MOVE: 'SEM_PSG01/PSG___00000_080_V1' TO rpt_tech_id .
      APPEND wa_var TO var .
      CLEAR :xml_out .
      REFRESH breturn .
      CALL FUNCTION 'Z_QUERY_EXECUTE'
        EXPORTING
          query_name            = rpt_tech_id
        IMPORTING
          xml_out               = xml_out
        TABLES
          return                = breturn
          meta                  = meta
        EXCEPTIONS
          bad_value_combination = 1
          user_not_authorized   = 2
          unknown_error         = 3
          query_not_found       = 4
          OTHERS                = 5.
      CASE sy-subrc .
        WHEN 0 .
          CLEAR: is_fieldcat, wa_meta .
          REFRESH: it_fieldcat .
          LOOP AT meta INTO wa_meta.
            is_fieldcat-fieldname = wa_meta-fieldname.
            is_fieldcat-outputlen = wa_meta-outputlen .
            is_fieldcat-datatype = wa_meta-datatype.
            is_fieldcat-scrtext_l = wa_meta-scrtext_l.
            APPEND is_fieldcat TO it_fieldcat.
            CLEAR : is_fieldcat .
          ENDLOOP .
          IF NOT it_fieldcat[] IS INITIAL .
            CALL METHOD cl_alv_table_create=>create_dynamic_table
              EXPORTING
                it_fieldcatalog = it_fieldcat
              IMPORTING
                ep_table        = new_table.
            ASSIGN new_table->* TO <outtab>.
          ENDIF .
          TRY .
              CALL TRANSFORMATION ('Z_GPS_TR')
              SOURCE XML  xml_out
              RESULT     outtab = <outtab>.
            CATCH cx_xslt_exception INTO xslt_error.
              xslt_message = xslt_error->get_text( ).
          ENDTRY.
        WHEN 1 .
        WHEN 2 .
        WHEN OTHERS .
      ENDCASE .
    {ENDFUNCTION.
    'Z_GPS_TR' is my transformation (exactly the code from the blog).
    'Z_QUERY_EXECUTE' is the function from 1). I did not use variables for the query parameter.
    I see with  the debugger that <outtab> is filled corectly, with the values from my query.  Still , the function, when is runed normally, does not display anything.
    3) If I run only the transformation Z_GPS_TR alone, it says invalid source XM source file.
    Please, some suggestion? I don't know hot to proceed.
    Many thanks.
    Edited by: Ariana D on May 19, 2009 11:40 AM

    Hi All
    I able to solve this problem
    Regards
    Satrajit.

  • How to upload an excel file using ABAP.

    Hi,
    Can anyone please help me in understanding how to upload an excel file using ABAP.
    Thanks!!

    http://diocio.wordpress.com/2007/02/12/sap-upload-excel-document-into-internal-table/
    check the link
    TYPES: Begin of t_record,
    name1 like itab-value,
    name2 like itab-value,
    age   like itab-value,
    End of t_record.
    DATA: it_record type standard table of t_record initial size 0,
    wa_record type t_record.
    DATA: gd_currentrow type i.
    *Selection Screen Declaration
    PARAMETER p_infile like rlgrap-filename.
    *START OF SELECTION
    call function ‘ALSM_EXCEL_TO_INTERNAL_TABLE’
    exporting
    filename                = p_infile
    i_begin_col             = ‘1&#8242;
    i_begin_row             = ‘2&#8242;  “Do not require headings
    i_end_col               = ‘14&#8242;
    i_end_row               = ‘31&#8242;
    tables
    intern                  = itab
    exceptions
    inconsistent_parameters = 1
    upload_ole              = 2
    others                  = 3.
    if sy-subrc <> 0.
    message e010(zz) with text-001. “Problem uploading Excel Spreadsheet
    endif.
    Sort table by rows and colums
    sort itab by row col.
    Get first row retrieved
    read table itab index 1.
    Set first row retrieved to current row
    gd_currentrow = itab-row.
    loop at itab.
      Reset values for next row
    if itab-row ne gd_currentrow.
    append wa_record to it_record.
    clear wa_record.
    gd_currentrow = itab-row.
    endif.
    case itab-col.
    when ‘0001&#8242;.                              “First name
    wa_record-name1 = itab-value.
    when ‘0002&#8242;.                              “Surname
    wa_record-name2 = itab-value.
    when ‘0003&#8242;.                              “Age
    wa_record-age   = itab-value.
    endcase.
    endloop.
    append wa_record to it_record.
    *!! Excel data is now contained within the internal table IT_RECORD
    Display report data for illustration purposes
    loop at it_record into wa_record.
    write:/     sy-vline,
    (10) wa_record-name1, sy-vline,
    (10) wa_record-name2, sy-vline,
    (10) wa_record-age, sy-vline.
    endloop.

  • Manual price condition (%) in order creation (using ABAP)

    Dear community members,
    I could use some help on a problem I have encountered while creating a sales order (in the CRM system) using ABAP programming, the details are given hereunder:
    I have two manual price conditions used to set a possible discount, one using a straight value and one using a percentage:
    1. When the order is generated using the value (let us say 100€) it cointains the correct price condition.
    2. On the other hand, when the order is generated using percentages (i.e. 10%), it is created without explicit errors or warnings but with no price condition in it.
    For the latter case I have checked the IPC logs (from transaction SM53) finding this error message:
    Message: Condition cannot be processed manually
    --> com.sap.spe.pricing.transactiondata.exc.ManualChangeNotAllowedException: Condition YSCP cannot be processed manually
    at com.sap.spe.pricing.transactiondata.impl.PricingCondition.changeConditionRate(Ljava/math/BigDecimal;Ljava/lang/String;Ljava/math/BigDecimal;Ljava/lang/String;)V(PricingCondition.java:3124)
    at com.sap.spe.pricing.transactiondata.impl.HeaderCondition.changeConditionRate(Ljava/math/BigDecimal;Ljava/lang/String;Ljava/math/BigDecimal;Ljava/lang/String;)V(HeaderCondition.java:387)
    at com.sap.spe.pricing.transactiondata.impl.PricingDocument.addHeaderCondition(Ljava/lang/String;Ljava/math/BigDecimal;Ljava/lang/String;Ljava/math/BigDecimal;Ljava/lang/String;C)Lcom/sap/spe/pricing/transactiondata/IHeaderCondition;(PricingDocument.java :1472)
    at com.sap.spe.document.rfc.AddPricingConditions.handleDocRequest()V(AddPricingConditions.java:131)
    at com.sap.spe.document.rfc.DocHandlerAdapter.handleRequest()V(DocHandlerAdapter.java:72)
    at com.sap.spe.base.util.jco.HandlerAdapter.handleRequest(Lcom/sap/vmc/RFCContainer/Call;)V(HandlerAdapter.java:117)
    at com.sap.vmc.remserver.RFCDispatcher.handleRequest2(Lcom/sap/conn/jco/JCoFunction;)V(RFCDispatcher.java:995)
    at com.sap.vmc.remserver.RFCDispatcher.handleRequest(Lcom/sap/conn/jco/JCoFunction;)V(RFCDispatcher.java:746)
    at com.sap.conn.jco.rt.VMCServer.dispatchRequest(Lcom/sap/conn/jco/JCoFunction;)V(VMCServer.java:911)
    at com.sap.conn.jco.rt.MiddlewareJavaRfc$JavaRfcServer.dispatchRequest(Lcom/sap/conn/jco/rt/ServerWorker;Ljava/lang/String;)V(MiddlewareJavaRfc.java:3415)
    at com.sap.conn.jco.rt.MiddlewareJavaRfc$JavaRfcServer.listen(Lcom/sap/conn/jco/rt/ServerWorker;)V(MiddlewareJavaRfc.java:2468)
    at com.sap.conn.jco.rt.VMCServer.listen()V(VMCServer.java:766)
    at com.sap.conn.jco.rt.VMCServer.run()V(VMCServer.java:689)
    at com.sap.vmc.remserver.RfcServer.run()V(RfcServer.java:376)
    at java.lang.Thread.startup(Z)V(Thread.java:1954)
    I have already debugged FM CRM_ORDER_MAINTAIN but to no avail, maybe I just missed something and I can assure that the customizing is correct and aligned between the systems and both the conditions are set to be processed manually.
    At this point, since the condition is applied when the commit is yet to be done I wonder whether it is possible to apply a discount percentage on prices which are yet to be generated, it would be illogical to do so and then again while using a straight value (which does not require a calculation) the order is correctly generated.
    Furthermore when I add the conditions in an order (from both the GUI and the WUI) the table IT_PRIDOC is alway empty, even if CT_INPUT_FIELD is populated.
    I know that there are similar posts here in SCN but sadly I was not able to find a solution so any help would be greatly appreciated.
    Thanks in advance for any replies given,
    Alessandro.

    Dear Padma,
    apologies for my late reply. I also thought it should be possible to use a percentage but I was not sure.
    Sadly the debugging did not bring about any positive result.
    I also tried to make a second CRM_ORDER_MAINTAIN call after the system generated all the pricing conditions but that also did not work.
    There is one thing that caught my attention though:
    - YSCV (fixed amount): still no problem at all (passed to KBETR);
    - YSCP (percent): if I assign a value to KWERT or if I leave all the fields empty, the condition is created in the sales order but it is always set to 0%. However, if I try to assign it to KBETR, I always get the message: "Condition YSCP cannot be processed manually".
    I made some attempts with the customizing, for example adding the condition to the "easy entries" or playing with the options of "Create Condition Types" (always aligning the systems) without getting positive output.
    I am beginning to think that it could be an IPC-related problem (which is not my area of expertise... yet).
    Alessandro.

  • Execute a query using ABAP  (XSLT transformation issue)

    Hello,
    I made the steps from this blog (part I, II and III).
    /people/durairaj.athavanraja/blog/2005/12/05/execute-bw-query-using-abap-part-iii
    When trying to run the XSLT transformation, I got the message that : XML invalid source file.
    I am not sure what are the steps for running a transformation, or running it for this case ,maybe something it's not ok. I just run it, did not provide any information.
    Any suggestions ? Did anyone use the function module described in this blog ?
    Thank you very much in advance.

    try giving
    CALL TRANSFORMATION (`ID`)
    SOURCE meta = meta_data[]
    output = <ltable>[]
    RESULT XML xml_out
    OPTIONS xml_header = 'NO'.
    and check - sometimes the codepages configured in the BW system tend to cause an issue... I am not sure if the syntax is right though - but you are basically trying to bypass any encoding that is happening in the query transformation....
    http://www.sapetabap.com/ovidentia/index.php?tg=fileman&sAction=getFile&inl=1&id=4&gr=Y&path=ABAP%2FABAPENANGLAIS&file=ABAP-XML+Mapping.pdf&idf=41
    Edited by: Arun Varadarajan on May 18, 2009 11:28 PM

  • How to use abap memory in global class

    Hi experts,
                     I want to  know how to use abap memory in global class. when i try write export and import statement its showing
    error is export statement does not support in object oriented concept.
    Thanks
    Ramesh Manoharan

    Hi Ramesh,
    Export and import statements were not allowed to use in  classes. Create a global variable in public section of that class of type of  export parameter.Then pass value to the global variable of class  by calling that class.
    by
    Prasad GVK.

  • Unzip files using ABAP program

    Hi All,
    Can anybody guide me how to Unzip a .zip file using ABAP program... Appreciate your immediate reply...
    actually, my scenario is to check whether zip file is created in appl.server or not.., and if zip file created then i need to check whether its blank file or any content exist inside the file...
    Thanks in advance
    Bhasker

    hi
    good
    parameters: command(236) lower case.
    data: std_lines(255) occurs 0 with header line.
      call function 'RFC_REMOTE_PIPE'
        destination 'SERVER_EXEC'
        exporting
          command = command
          read = 'X'
        tables
          pipedata = std_lines
        exceptions
          communication_failure = 1
          system_failure = 2.
    You should put your Unix command in the command parameter. "gunzip /yourfilepath/yourfilename" works on my Unix system. Once you determine the proper Unix command, you should be set. This technique is also nice because it provides you with echos back from Unix in table std_lines. For more complex Unix activity, you may want to consider throwing together a Unix script, and calling that via this code.
    reward point if helpful.
    thanks
    mrutyun^

  • Missing code in "Offline Interactive Forms Using ABAP" SDN document?

    I am trying to build a sample offline form scenario using the code published in the SDN document "Offline Interactive Forms Using ABAP" written by Vani Krishnamoorthy. Everything works perfectly up to the point where we instantiate the PDF Object to extract the data from the form. Then there seems to be some code missing just before we call the method SET_DOCUMENT. We are supposed to export the parameter pdfdata = pdf_data , but I cannot find where pdf_data variable is declared or assigned. Also, an ENDTRY statement seems to be missing.
    Has anyone had success with Vani's offline scenario, and if so, do you know what code is missing, if any?
    Thanks in advance for any help you can offer.

    I found the missing code in sample program FP_PDF_TEST_06. Everything works well now.
    The PDF file that was uploaded from the PC first needs to be converted from binary to XSTRING before you can create the PDF object:
    data: lt_rawtab type standard table of raw255,
            g_pdfdata type xstring,
            l_len type i.
      call method cl_gui_frontend_services=>gui_upload
        exporting
          filename                = l_filename
          filetype                = 'BIN'
        importing
          filelength              = l_len
        changing
          data_tab                = lt_rawtab   "PDF file (binary)
        exceptions
          file_open_error         = 1
          file_read_error         = 2
          etc. etc.
    Convert binary tab to Xstring
      call function 'SCMS_BINARY_TO_XSTRING'
        exporting
          input_length = l_len
        importing
          buffer       = g_pdfdata              "converted to Xstring         
        tables
          binary_tab   = lt_rawtab
        exceptions
          failed       = 1
          others       = 2.
      if sy-subrc is not initial.
        message id sy-msgid type sy-msgty number sy-msgno
                   with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      endif.
    Instantiate PDF object..
      data: l_fp     type ref to if_fp value is initial,
            l_pdfobj type ref to if_fp_pdf_object value is initial,
            l_fpex    type ref to cx_fp_runtime,
            l_type    type string,
            l_errmsg  type string.
    Get FP reference
      l_fp = cl_fp=>get_reference( ).
    Handle exceptions with Try..Endtry
      try.
      Create PDF Object using destination 'ADS' (<--this is how it is
      defined in SM59)
          l_pdfobj = l_fp->create_pdf_object( connection = 'ADS' ).
      Set document
          l_pdfobj->set_document( exporting pdfdata = g_pdfdata ). 
      Tell PDF object to extract data
          l_pdfobj->set_extractdata( ).
      Execute the call to ADS
          l_pdfobj->execute( ).
        catch cx_fp_runtime_internal
              cx_fp_runtime_system
              cx_fp_runtime_usage into l_fpex.
          case cl_abap_classdescr=>get_class_name( l_fpex ).
            when '\CLASS=CX_FP_RUNTIME_INTERNAL'.
              l_type = 'INTERNAL ERROR'.
            when '\CLASS=CX_FP_RUNTIME_SYSTEM'.
              l_type = 'SYSTEM ERROR'.
            when '\CLASS=CX_FP_RUNTIME_USAGE'.
              l_type = 'USAGE ERROR'.
          endcase.
          l_errmsg = l_fpex->get_short( ).
          message e010(ad) with l_type ':' l_errmsg.
      endtry.

  • How to extract a query in EXCEL Form using ABAP?

    Hi,
      is there a way using ABAP to extract the results from a specific BW Query and save them in an EXCEL format file?

    Hi,
    You can do it by using InfoSpoke or RSCRM_BAPI.
    see in the following URL, there one blog  in(https://wiki.sdn.sap.com/wiki/display/profile/Surendra+Reddy)
    How to transfer the Data from SAP-System to Non-SAP system without additional Cost/License
    /people/surendrakumarreddy.koduru/blog/2009/03/11/how-to-transfer-the-data-from-sap-system-to-non-sap-system-without-additional-costlicense
    Re: Running Quaries automatically and saving them in as a Excel file in Server
    Re: Data transfer to external systems
    Re: Loading from a Custom R/3 Table
    Re: How can I schedule my Bex report to execute in background
    Re: How can I insert the RSCRM_BAPI into Process chain?
    Thanks
    Reddy

  • TOP of PAGE  using ABAP oo with single CUSTOM CONTROL

    Can anybody please tell me how to handle TOP_OF_PAGE using ABAP OBJECTS with a SINGLE CUSTOM CONTROL and not with  SPLIT CONTAINER(i.e. using single CL_GUI_CUSTOM_CONTAINER and single grid CL_GUI_ALV_GRID  ). Is it possible if so Please help me out?

    Hi Ravi,
    Here is my code. i didn't handle the top_of_page event yet but created a method to handle.
    REPORT  ZSATEESH_ALV_CONTAINER MESSAGE-ID ZZ
                      LINE-SIZE 150 NO STANDARD PAGE HEADING.
    PROGRAM id        :  ZSATEESH_ALV_CONTAINER                         *
    Title             : Sales document report                           *
    Author            : Sateesh                                         *
    Date              :                                                 *
    CR#               :                                                 *
    Dev Initiative    :
    Description       :ALV GRID/LIST Report which displays the sales
                          document header data using ABAP Objects.
                              Modification Log
    Corr. no        date       programmer        description
                    TYPES Declaration
    *--Type for the Header Sales data
    TYPES: BEGIN OF TY_VBAK ,
            INDICAT LIKE ICON-ID,               " Icon
            VBELN   LIKE VBAK-VBELN,            " Sales Document
            AUDAT   LIKE VBAK-AUDAT,            " Document date
            VBTYP   LIKE VBAK-VBTYP,            " SD document category
            AUART   LIKE VBAK-AUART,            " Sales Document Type
            AUGRU   LIKE VBAK-AUGRU,            " Order reason
            NETWR   LIKE VBAK-NETWR,            " Net Value
            WAERK   LIKE VBAK-WAERK,            " SD document currency
         END OF TY_VBAK.
                    DATA Declaration
    *--Tableto hold the header sales data
    DATA: TB_VBAK  TYPE  STANDARD TABLE OF TY_VBAK.
    *--Table to hold the Icons
    DATA: BEGIN OF TB_ICON OCCURS 0,
            ID   TYPE ICON-ID,                  " Icon
            NAME TYPE ICON-NAME,                " Name of an Icon
          END OF TB_ICON.
    *--Declaration of ALV Grid Tables
    DATA: TB_FDCAT         TYPE LVC_T_FCAT,     " Fieldcatalog
          TB_SORT          TYPE LVC_T_SORT.     " Sorting
    DATA: OK_CODE          LIKE SY-UCOMM.       " sy-ucomm
    *--Reference variables for container and grid control.
    DATA: CUSTOM_CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
                                                " Container reference
          OBJ_ALV_GRID     TYPE REF TO CL_GUI_ALV_GRID.
    " Alv Grid reference
                      S T R U C T U R E S
    DATA: X_FDCAT          TYPE LVC_S_FCAT,     " Fieldcatalog
          X_LAYOUT         TYPE LVC_S_LAYO,     " layout
          X_SORT           TYPE LVC_S_SORT,     " Sorting
          X_VBAK           TYPE TY_VBAK,        " sales header stucture
          X_ICON           LIKE TB_ICON.        " icons structure
                      C O N S T A N T S
    *--Declaration of Constants
    CONSTANTS :
                C_GREEN(40)    TYPE  C VALUE 'ICON_GREEN_LIGHT',
                C_RED(40)      TYPE  C VALUE 'ICON_RED_LIGHT',
                C_YELLOW(40)   TYPE  C VALUE 'ICON_YELLOW_LIGHT',
                C_X            TYPE  C VALUE 'X'.      " Flag
                      SELECTION SCREEN
    *--Block 1.
    SELECTION-SCREEN : BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    PARAMETER: P_AUDAT LIKE VBAK-AUDAT
                       DEFAULT '20050101'(003).    " doc date.
    SELECTION-SCREEN: END OF BLOCK B1.
    *--bLOCK 2.
    SELECTION-SCREEN : BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-002.
    PARAMETER :P_ALVDIS AS CHECKBOX.              " For List/Grid
    SELECTION-SCREEN : END OF BLOCK B2.
          Class LC_VBAK  definition
    CLASS  LC_VBAK DEFINITION.
      PUBLIC SECTION.
        METHODS: VBAK_POPULATE,                 " sales header population
                 ICON_POPULATE,                 " Icons population
                 FINAL_POPULATE,                " Final ALV population
                 DISPLAY,                      " Displaying ALV
                 TOP_OF_PAGE FOR EVENT TOP_OF_PAGE OF CL_GUI_ALV_GRID
                                               IMPORTING E_DYNDOC_ID.
    ENDCLASS.                    "LC_VBAK DEFINITION
          Class LC_VBAK IMPLEMENTATION
    CLASS LC_VBAK IMPLEMENTATION.
      METHOD VBAK_POPULATE.
    *-- selecting from VBAK
        SELECT VBELN
                AUDAT
                VBTYP
                AUART
                AUGRU
                NETWR
                WAERK
                INTO   CORRESPONDING FIELDS OF TABLE TB_VBAK
                FROM VBAK
                WHERE AUDAT > P_AUDAT AND
                NETWR  > 0.
        IF SY-SUBRC <> 0.
          SORT TB_VBAK  BY AUART VBTYP WAERK .
        ENDIF.
      ENDMETHOD .                    "VBAK_POPULATE
      METHOD ICON_POPULATE.
    *--selecting from ICON table
        SELECT ID
               NAME
               INTO TABLE TB_ICON
               FROM ICON.
        IF SY-SUBRC = 0.
          SORT TB_ICON BY NAME .
        ENDIF.
      ENDMETHOD .                    "ICON_POPULATE
      METHOD FINAL_POPULATE.
    *--looping through VBAK table into the work area
        LOOP AT TB_VBAK INTO X_VBAK .
          IF X_VBAK-NETWR <= 10.
    *--Reading the ICON table into work area comparing field NAME
            READ TABLE TB_ICON INTO X_ICON WITH KEY NAME = C_GREEN
                                                     BINARY SEARCH.
            IF SY-SUBRC = 0.
              X_VBAK-INDICAT =  X_ICON-ID.
    *--modifying the TB_VBAK table
              MODIFY TB_VBAK FROM X_VBAK.
            ENDIF.
          ELSEIF X_VBAK-NETWR > 10 AND X_VBAK-NETWR < 100.
    *--Reading the ICON table into work area comparing field NAME
            READ TABLE TB_ICON INTO X_ICON WITH KEY NAME = C_YELLOW
                                                     BINARY SEARCH.
            IF SY-SUBRC = 0.
              X_VBAK-INDICAT =  X_ICON-ID.
    *--modifying the TB_VBAK table
              MODIFY TB_VBAK FROM X_VBAK.
            ENDIF.
          ELSEIF X_VBAK-NETWR >= 100.
    *--Reading the ICON table into work area comparing field NAME
            READ TABLE TB_ICON INTO X_ICON WITH KEY NAME = C_RED
                                                     BINARY SEARCH.
            IF SY-SUBRC = 0.
              X_VBAK-INDICAT =  X_ICON-ID.
    *--modifying the TB_VBAK table
              MODIFY TB_VBAK FROM X_VBAK.
            ENDIF.
          ENDIF.
        ENDLOOP.
      ENDMETHOD.                    "FINAL_POPULATE
          METHOD top_of_page                                            *
      METHOD TOP_OF_PAGE.
        PERFORM EVENT_TOP_OF_PAGE USING E_DYNDOC_ID.
      ENDMETHOD.                    "top_of_page
      METHOD DISPLAY.
    *--Building fieldcatalog table
        PERFORM FIELDCATLOG.
    *--FOr making the Layout settings
        PERFORM LAYOUT.
    *--For sorting the fields
        PERFORM SORTING.
    *--perform for displaying the ALV
        PERFORM ALV_GRID_DISPLAY.
      ENDMETHOD.                    "DISPLAY
    ENDCLASS.                    "LC_VBAK IMPLEMENTATION
    *&      Form  FIELDCATLOG
         Building the FIELDCATALOG
    FORM FIELDCATLOG .
      CLEAR: X_FDCAT,TB_FDCAT[].
      X_FDCAT-ROW_POS   = 1.
      X_FDCAT-COL_POS   = 1.
      X_FDCAT-FIELDNAME = 'INDICAT'(004) .
      X_FDCAT-TABNAME   = 'TB_VBAK'(005).
      X_FDCAT-SCRTEXT_L = 'STATUS_INDICATOR'(006).
      APPEND X_FDCAT TO TB_FDCAT.
      X_FDCAT-ROW_POS   = 1.
      X_FDCAT-COL_POS   = 2.
      X_FDCAT-FIELDNAME = 'VBELN'(007) .
      X_FDCAT-TABNAME   = 'TB_VBAK'(005).
      X_FDCAT-SCRTEXT_L = 'SALES DOC'(008).
      APPEND X_FDCAT TO TB_FDCAT.
      X_FDCAT-ROW_POS   = 1.
      X_FDCAT-COL_POS   = 3.
      X_FDCAT-FIELDNAME = 'AUDAT'(009) .
      X_FDCAT-TABNAME   = 'TB_VBAK'.
      X_FDCAT-SCRTEXT_L = 'DOC DATE'(010).
      APPEND X_FDCAT TO TB_FDCAT.
      X_FDCAT-ROW_POS   = 1.
      X_FDCAT-COL_POS   = 4.
      X_FDCAT-FIELDNAME = 'VBTYP'(011) .
      X_FDCAT-TABNAME   = 'TB_VBAK'.
      X_FDCAT-SCRTEXT_L = 'SALES CATEGORY'(012).
      APPEND X_FDCAT TO TB_FDCAT.
      X_FDCAT-ROW_POS   = 1.
      X_FDCAT-COL_POS   = 5.
      X_FDCAT-FIELDNAME = 'AUART'(013) .
      X_FDCAT-TABNAME   = 'TB_VBAK'.
      X_FDCAT-SCRTEXT_L = 'DOC TYPE'(014).
      APPEND X_FDCAT TO TB_FDCAT.
      X_FDCAT-ROW_POS   = 1.
      X_FDCAT-COL_POS   = 6.
      X_FDCAT-FIELDNAME = 'AUGRU'(015) .
      X_FDCAT-TABNAME   = 'TB_VBAK'.
      X_FDCAT-SCRTEXT_L = 'REASON'(016).
      APPEND X_FDCAT TO TB_FDCAT.
      X_FDCAT-ROW_POS   = 1.
      X_FDCAT-COL_POS   = 7.
      X_FDCAT-FIELDNAME = 'NETWR'(017) .
      X_FDCAT-TABNAME   = 'TB_VBAK'.
      X_FDCAT-SCRTEXT_L = 'NET VALUE'(018).
      X_FDCAT-DO_SUM   = C_X.
      APPEND X_FDCAT TO TB_FDCAT.
      X_FDCAT-ROW_POS   = 1.
      X_FDCAT-COL_POS   = 8.
      X_FDCAT-FIELDNAME = 'WAERK'(019) .
      X_FDCAT-TABNAME   = 'TB_VBAK'.
      X_FDCAT-SCRTEXT_L = 'UNIT'(020).
      APPEND X_FDCAT TO TB_FDCAT.
    ENDFORM.                    " FIELDCATLOG
    *&      Module  STATUS_0007  OUTPUT
          module for setting the pf status
    MODULE STATUS_0007 OUTPUT.
      SET PF-STATUS 'ZSTATUS'.
    SET TITLEBAR 'xxx'.
    ENDMODULE.                 " STATUS_0007  OUTPUT
    *&      Module  USER_COMMAND_0007  INPUT
          module  for handling the user commands
    MODULE USER_COMMAND_0007 INPUT.
      OK_CODE = SY-UCOMM.
      CASE OK_CODE.
        WHEN 'BACK'.
          LEAVE TO SCREEN 0.
        WHEN 'CANCEL'.
          LEAVE TO SCREEN 0.
        WHEN 'EXIT'.
          LEAVE TO SCREEN 0.
      ENDCASE.
    ENDMODULE.                 " USER_COMMAND_0007  INPUT
    *&      Form  LAYOUT
          ALV Layout settings
    FORM LAYOUT .
      CLEAR X_LAYOUT.
    *-- making Layout settings
      X_LAYOUT-GRID_TITLE = 'Sales Header Document'(021).
      X_LAYOUT-ZEBRA      = C_X.
      IF P_ALVDIS =  C_X.
        X_LAYOUT-NO_HGRIDLN = C_X.
        X_LAYOUT-NO_VGRIDLN = C_X.
      ENDIF.
    ENDFORM.                    " LAYOUT
    *&      Form  SORTING
          sub routine for sorting criteria
    FORM SORTING .
      CLEAR X_SORT.
      X_SORT-SPOS = '1'(022).
      X_SORT-FIELDNAME = 'AUART'.
      X_SORT-UP        = C_X.
      APPEND X_SORT TO TB_SORT.
      CLEAR X_SORT.
      X_SORT-SPOS = '2'(023).
      X_SORT-FIELDNAME = 'VBTYP'.
      X_SORT-UP        = C_X.
      APPEND X_SORT TO TB_SORT.
      CLEAR X_SORT.
      X_SORT-SPOS = '3'(024).
      X_SORT-FIELDNAME = 'WAERK'.
      X_SORT-UP        = C_X.
      X_SORT-SUBTOT    = C_X.
      APPEND X_SORT TO TB_SORT.
    ENDFORM.                    " SORTING
    *&      Form  CREATE_CONTAINER_OBJECT
          subroutine to create object of container
    FORM CREATE_CONTAINER_OBJECT .
      CREATE OBJECT CUSTOM_CONTAINER
        EXPORTING
          CONTAINER_NAME              = 'CUST_CONTROL'(025)
        EXCEPTIONS
          CNTL_ERROR                  = 1
          CNTL_SYSTEM_ERROR           = 2
          CREATE_ERROR                = 3
          LIFETIME_ERROR              = 4
          LIFETIME_DYNPRO_DYNPRO_LINK = 5
          OTHERS                      = 6
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                   WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " CREATE_CONTAINER_OBJECT
    *&      Form  CREATE_ALV_GRID_OBJECT
          subroutine to create object of ALV GRID
    FORM CREATE_ALV_GRID_OBJECT .
      CREATE OBJECT OBJ_ALV_GRID
        EXPORTING
          I_PARENT          = CUSTOM_CONTAINER
        EXCEPTIONS
          ERROR_CNTL_CREATE = 1
          ERROR_CNTL_INIT   = 2
          ERROR_CNTL_LINK   = 3
          ERROR_DP_CREATE   = 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.
    ENDFORM.                    " CREATE_ALV_GRID_OBJECT
    *&      Form  ALV_GRID_DISPLAY
          subroutine to call method for displaying the ALV GRID
    FORM ALV_GRID_DISPLAY .
      CALL METHOD OBJ_ALV_GRID->SET_TABLE_FOR_FIRST_DISPLAY
        EXPORTING
          IS_LAYOUT                     = X_LAYOUT
        CHANGING
          IT_OUTTAB                     = TB_VBAK
          IT_FIELDCATALOG               = TB_FDCAT
          IT_SORT                       = TB_SORT
        EXCEPTIONS
          INVALID_PARAMETER_COMBINATION = 1
          PROGRAM_ERROR                 = 2
          TOO_MANY_LINES                = 3
          OTHERS                        = 4.
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                   WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      CALL SCREEN 0007.
    ENDFORM.                    " ALV_GRID_DISPLAY
                    START OF SELECTION
    START-OF-SELECTION.
    *--Creating a reference variable for the class LC_VBAK
      DATA : OBJ1 TYPE REF TO LC_VBAK.
    *--Creating a container object
      PERFORM CREATE_CONTAINER_OBJECT.
    *--Creating a ALV GRID control object
      PERFORM CREATE_ALV_GRID_OBJECT.
    *--Creating a object of class LC_VBAK
      CREATE OBJECT OBJ1.
    *--calling vbak population method
      CALL METHOD OBJ1->VBAK_POPULATE.
    *--calling icon population method
      CALL METHOD OBJ1->ICON_POPULATE.
    *--calling fianl table population method
      CALL METHOD OBJ1->FINAL_POPULATE.
    *--calling final  method for display
      CALL METHOD OBJ1->DISPLAY.
    *&      Form  EVENT_TOP_OF_PAGE
          text
         -->P_E_DYNDOC_ID  text
    FORM EVENT_TOP_OF_PAGE  USING    P_E_DYNDOC_ID TYPE REF TO
                                                      CL_DD_DOCUMENT.
    ENDFORM.                    " EVENT_TOP_OF_PAGE

  • SAP object enhancement using abap objects

    Hi
    I am enhancing a standard SAP object using ABAP objects.
    I need to add 2 more fields to the struct in that object.
    My qn is : how to redefine the parameter type of a method in standard class?
    the code is
    DATA: lt_list TYPE RCF_T_LIST_MASS_PROC_ACT_X.
    CHECK me->start_selection EQ true.
    CHECK exist_exception( ) EQ false.
    DATA lo_ex TYPE REF TO cx_hrrcf.
    TRY.
    CALL METHOD me->ref_mass_proc_bl->get_mproc_cor_list_info
    EXPORTING
    mass_proc_cor_list = me->sel_mass_proc_cor
    IMPORTING
    mass_proc_list_info = lt_list.
    CATCH cx_hrrcf INTO lo_ex.
    add_exception( lo_ex ).
    ENDTRY.
    plz help me
    if anyone provides code for this is appreciable.
    Thanks

    Hi,
    either you can use the append technique <a href="http://help.sap.com/saphelp_nw04/helpdata/en/cf/21ebc9446011d189700000e8322d00/content.htm">Append</a>
    or you can define an additional import parameter.
    Best Regards, Edgar

  • How to bypass printer setting using abap code?

    Dear All,
    I want to bypass printer setting using abap code?
    I am printing sticker using a code and i dont want to display printer setting .
    I want direct ouput ?
    Regards
    Steve

    Are you using reports or scripts/smart forms? You can use the parameter for no_dialog = space(use the relevant parameter).

Maybe you are looking for