Macros definition in SOP

Hi,
I have got some doubts about macro definitions in SOP.
First, I would like to know how to use the ">" and "<" operators. Sometimes in the sequence of instructions they seem to behave as IF sentences.
Example
Operand 1           Operator             Operand 1           Result
      A                       >                        0                       A
Moreover I would like to know how to refer to an operand in a certain column in my table.
Thus, I would be very grateful if someone could tell where to get an useful SOP macros tutorial.
Thanks in advance.

Hi, here you can find the operations (formulas) that we would like to implement using simple macros in the MC8A transaction, and all the fields involved. Obviously, we can create any other auxiliar field that might we need. Please do not care about row names since they are in Spanish.
FIRST OPERATION
Row names involved
-Cantidad picaroles previsión segura  -
A
-Cantidad de picaroles (interface) -
B
-Previsiones seguras -
>C
Operation to implement
A = MAX (B,C)
SECOND OPERATION
-Cantidad teórica picarol -
A
-Cantidad picaroles previsión segura   -
B
-Cantidad picaroles 100 (INTERFACE)  -
C
-Cantidad picarol mix o Dummy -
D
Operation to implement
D = IF ((A-(BC))<0; 0; (A-(BC)))
Thanks a lot again for your help. This is very urgent so I would be very grateful if you could please at least spend some time in finding a solution.
Ben.

Similar Messages

  • Macros in Flexible SOP

    Hi,
    I am trying to copy the macros in SOPDIS to planning type created for custom developed infostructure.
    But it is adding the lines in macro in between the lines for macro ZLAG, Can you Please any bofy let me know how to resolve this?

    Hi
    They atre simple mathematical formulas.
    for ex:- you must be using the std SOP.
    In the screen you are giving sales qty &target stock level.
    You are calculate the production qty for target stock qty.
    you8 can see this formula in std SOP in Mc87.
    Regards
    YMREDDY

  • How to use macro's functionality in a programe...?

    hi,
    i am siva,
    i am new to abap,
    i am not having clarity on how to use macro in a programe,
    please send me any source code of a programe which
    contain functionality of macros..?
    and explain functionality of macros...?
    i any of u know answer..
    please send me source code of a programe that use macros...?
    reguars,
    siva.

    Hi,
    <u>Macros:</u>
    If you want to reuse the same set of statements more than once in a program, you can include
    them in a macro. For example, this can be useful for long calculations or complex WRITE
    statements. You can only use a macro within the program in which it is defined, and it can only
    be called in lines of the program following its definition.
    The following statement block defines a macro <macro>:
    DEFINE <macro>.
    <statements>
    END-OF-DEFINITION.
    You must specify complete statements between DEFINE and END-OF-DEFINITION. These
    statements can contain up to nine placeholders (&1, &2, ..., &9). You must define the macro
    before the point in the program at which you want to use it.
    Macros do not belong to the definition part of the program. This means that the DEFINE...ENDOF-
    DEFINITION block is not interpreted before the processing blocks in the program. At the
    same time, however, macros are not operational statements that are executed within a
    processing block at runtime. When the program is generated, macro definitions are not taken
    into account at the point at which they are defined. For this reason, they do not appear in the
    overview of the structure of ABAP programs [Page 44].
    A macro definition inserts a form of shortcut at any point in a program and can be used at any
    subsequent point in the program. As the programmer, you must ensure that the macro
    definition occurs in the program before the macro itself is used. Particular care is required if you
    use both macros and include programs, since not all include programs are included in the syntax
    check (exception: TOP include).
    To use a macro, use the following form:
    <macro> [<p1> <p2> ... <p9>].
    When the program is generated, the system replaces <macro> by the defined statements and
    each placeholder &i by the parameter <pi>. You can use macros within macros. However, a
    macro cannot call itself.
    Ex:
    DATA: RESULT TYPE I,
    N1 TYPE I VALUE 5,
    N2 TYPE I VALUE 6.
    DEFINE OPERATION.
    RESULT = &1 &2 &3.
    OUTPUT &1 &2 &3 RESULT.
    END-OF-DEFINITION.
    DEFINE OUTPUT.
    WRITE: / 'The result of &1 &2 &3 is', &4.
    END-OF-DEFINITION.
    OPERATION 4 + 3.
    OPERATION 2 ** 7.
    OPERATION N2 - N1.
    The produces the following output:
    The result of 4 + 3 is 7
    The result of 2 ** 7 is 128
    The result of N2 - N1 is 1
    Here, two macros, OPERATION and OUTPUT, are defined. OUTPUT is nested in
    OPERATION. OPERATION is called three times with different parameters. Note how
    the placeholders &1, &2, ... are replaced in the macros.
    Regards,
    Bhaskar

  • Standard Macro and Functional Module in HR -Programming.

    Hi friends,
    Could i know the difference between a standard macro and a function module in hr programming.
    how do we have to use that and what are the different std macro's and functional modules used in HR-Programming...
    Thanks in Advance..
    Regards
    Shiva

    You will find the macros in table TRMAC .
    Macros are set of pre defined instructions .
    You can define your own macros in the program using 'definition' command  or use standard macros.
    you will find most of the HR function module starting  with HR*  or RH * .
    You can get Macro  definition  /  its fundamental difference with function module on web .
    Hopw this is helpful

  • HR ABAP Macro include files?

    Hi all ABAPers,
    I am trying to develope a BAPI using HR ABAP Macro. (Eg RP-EXP-C1-TX ,RP-EXP-C3-TY)
    obviously, ABAP Macro is pretty new to me....
    I have a feeling HR ABAP macro requires me to "Include" some file beforeI can use it.
    Can anyone please let me know what include file I should put it on.
    Any help appreciated!!!!

    Hi,
    before you can use it ABAP macro requires you to define it
    in the program ( or one of its includes) or in table TRMAC.
    In the macro definition you can use tables, files etc.
    e. g. for macro
    AA-BB-DD-XX
    you should code in the program ( or one of its includes):
    DEFINE AA-BB-DD-XX.
    LOOP AT ITAB.
    MOVE-CORRESPONDING ITAB TO ITAB2.
    ITAB2-FIELD1 = 8.
    APPEND ITAB2. " or write or upload etc.
    ENDLOOP.
    END-OF-DEFINITION.

  • Macro and Field Symbol

    Hi Experts,
    I want to assign the fields of a field symbol using a macro because the field names come from a table
    the code look like this
        DEFINE ASSIGN_VALUE.
          &1-&2 = &3.
        END-OF-DEFINITION.
        ASSIGN_VALUE <RESULT_FIELDS> FIELDNAME FIELDVALUE.
    Where FIELDNAME is a CHAR variable containing the name of the field
    I get the following error:
    E:The data object "<RESULT_FIELDS>" does not have a component called
    "FIELDNAME".
    The macro and the call to it are located in a method of a class ( end routine of a transformation in BW)
    Thanks for your help
    Thibault

    Hi
    Welcome to SDN forum
    See the doc of MACROS and do accordingly
    Macros
    If you want to reuse the same set of statements more than once in a program, you can include them in a macro. For example, this can be useful for long calculations or complex WRITE statements. You can only use a macro within the program in which it is defined, and it can only be called in lines of the program following its definition.
    The following statement block defines a macro macro:
    DEFINE makro.
       statements
    END-OF-DEFINITION.
    You must specify complete statements between DEFINE and END-OF-DEFINITION. These statements can contain up to nine placeholders &1, &2,...., &9). You must define the macro before the point in the program at which you want to use it.
    Macros do not belong to the definition part of the program. This means that the DEFINE statement block is not interpreted before the processing blocks in the program. At the same time, however, macros are not operational statements that are executed within a processing block at runtime. When the program is generated, macro definitions are not taken into account at the point at which they are defined. For this reason, they do not appear in the overview of the structure of processing logic.
    A macro definition inserts a form of shortcut at any point in a program and can be used at any subsequent point in the program. As the programmer, you must ensure that the macro definition occurs in the program before the macro itself is used. Particular care is required if you use both macros and include programs, since not all include programs are included in the syntax check (exception: TOP include).
    To use a macro, use the following form:
    makro [p1 p2... p9].
    When the program is generated, the system replaces the macro by the appropriate statements and the placeholders &1, &2, …, &9 by the parameter p1, p2, …, p9. You can use macros within macros. However, a macro cannot call itself.
    REPORT demo_mod_tech_macros.
    DATA: result TYPE i,
          n1     TYPE i VALUE 5,
          n2     TYPE i VALUE 6.
    DEFINE operation.
      result = &1 &2 &3.
      output   &1 &2 &3 result.
    END-OF-DEFINITION.
    DEFINE output.
      write: / 'The result of &1 &2 &3 is', &4.
    END-OF-DEFINITION.
    operation 4 + 3.
    operation 2 ** 7.
    operation n2 - n1.
    This produces the following output:
    The result of 4 + 3 is          7
    The result of 2 ** 7 is        128
    The result of N2 - N1 is          1
    In this example, the two macros operation and output are defined. output is nested in operation. operation is called three times with different parameters. Note how the placeholders &1, &2,... are replaced in the macros.
    The following example shows that a macro definition only works in the program lines following its definition. Do not copy it!
    Let us have a look at a program with a subroutine test:
    PROGRAM macro_test.
    FORM test.
      WRITE '...'.
    ENDFORM.
    We can rewrite the program by introducing a macro macro:
    PROGRAM macro_test.
    FORM test.
    DEFINE macro.
        WRITE '...'.
      ENDFORM.
    END-OF-DEFINITION.
    MACRO.
    Inserting the macro changes nothing in the generated form of the program. Processing blocks - here a subroutine - are always indivisible. We could also write the program as follows:
    PROGRAM macro_test.
    DEFINE macro.
        WRITE '...'.
      ENDFORM.
    END-OF-DEFINITION.
    FORM test.
    MACRO.
    The most essential feature of a macro definition is that it should occur before the macro is used.
    Macro in ABAP
    Macro in ABAP
    Submitted by : SAP Basis, ABAP Programming and Other IMG Stuff
                   http://www.sap-img.com
    REPORT ZMACRO.
    DATA: RESULT TYPE I,
          N1     TYPE I VALUE 5,
          N2     TYPE I VALUE 6.
    DEFINE OPERATION.
       RESULT = &1 &2 &3.
       OUTPUT   &1 &2 &3 RESULT.
    END-OF-DEFINITION.
    DEFINE OUTPUT.
       WRITE: / 'The result of &1 &2 &3 is', &4.
    END-OF-DEFINITION.
    OPERATION 4 + 3.
    OPERATION 2 ** 7.
    OPERATION N2 - N1.
    *-- End of Program
    Regards
    Anji

  • Dynamic Button Processing in Macro

    Hello Gurus,
                I have created macro's with the button option.
    The button is getting displayed in the planning book.
    When I load the value in the planning book I have to check whether the product memo text is availble.
    If the text is available Button text should be "YES" else text should be "NO".
    Please let me know is it possible to do? If not is there any way ( Changing the color of the button) to indicate the user that the product holds the text or not?
    Thanks in advance.
    Regards,
    Siva.

    Hi Siva,
                     Are you talking about the text associated with the material? This text is actually loaded through BW and I don't think there is any way to create a macro to check this...atleast out of box. But you can try using a program or a user exit in the macro definition and check whether the BW object has text loaded or not and then may be chnage the icon based on it....but I guess that's quite complex and not worth the effort just for checking the text is loaded to the material or not.
    Please let me know if I got this right.

  • Definition of IMPORTING  IS_KEYINFO in reuse_alv_hierseq_list_display

    function reuse_alv_hierseq_list_display.
    *"  IMPORTING
    *"     VALUE(IS_KEYINFO) TYPE  SLIS_KEYINFO_ALV
    hi could anyone explain the purpose if this importing parameter in the FM and a definition of its usage.  PLZZ

    Main purpose of IS_KEYINFO is to store the relationship between header and line item tables. i.e. key field name(s) that is common to both of these tables.
    For reference see this sample code:
    REPORT z_alv_hierseq_list.
    TYPE-POOLS: slis.                      " ALV Global types
    SELECTION-SCREEN :
      SKIP, BEGIN OF LINE,COMMENT 5(27) v_1 FOR FIELD p_max.    "#EC NEEDED
    PARAMETERS p_max(02) TYPE n DEFAULT '10' OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    DATA :
    1st Table
      BEGIN OF gt_vbak OCCURS 0,
        vbeln LIKE vbak-vbeln,             " Sales document
        kunnr LIKE vbak-kunnr,             " Sold-to party
        netwr LIKE vbak-netwr,             " Net Value of the Sales Order
    START-OF-SELECTION.
    Read data
      SELECT * FROM vbak
                 UP TO p_max ROWS
               INTO CORRESPONDING FIELDS OF TABLE gt_vbak.
      IF NOT gt_vbak[] IS INITIAL.
        SELECT * FROM vbap
                 INTO CORRESPONDING FIELDS OF TABLE gt_vbap
                  FOR ALL ENTRIES IN gt_vbak
                WHERE vbeln = gt_vbak-vbeln.
      ENDIF.
      PERFORM f_display.
          Form  F_DISPLAY
    FORM f_display.
    Macro definition
      DEFINE m_fieldcat.
        ls_fieldcat-tabname = &1.
        ls_fieldcat-fieldname = &2.
        ls_fieldcat-ref_tabname = &3.
        append ls_fieldcat to lt_fieldcat.
      END-OF-DEFINITION.
      DEFINE m_sort.
        ls_sort-tabname = &1.
        ls_sort-fieldname = &2.
        ls_sort-up        = 'X'.
        append ls_sort to lt_sort.
      END-OF-DEFINITION.
      DATA:
        ls_fieldcat TYPE slis_fieldcat_alv,
        lt_fieldcat TYPE slis_t_fieldcat_alv," Field catalog
        ls_sort     TYPE slis_sortinfo_alv,
        lt_sort     TYPE slis_t_sortinfo_alv," Sort table
        ls_keyinfo  TYPE slis_keyinfo_alv,
        ls_layout   TYPE slis_layout_alv.
      ls_layout-group_change_edit = 'X'.
      ls_layout-colwidth_optimize = 'X'.
      ls_layout-zebra             = 'X'.
      ls_layout-detail_popup      = 'X'.
      ls_layout-get_selinfos      = 'X'.
    Build field catalog and sort table
      m_fieldcat 'GT_VBAK' 'VBELN' 'VBAK'.
      m_fieldcat 'GT_VBAK' 'KUNNR' 'VBAK'.
      m_fieldcat 'GT_VBAK' 'NETWR' 'VBAK'.
      m_fieldcat 'GT_VBAK' 'ERDAT' 'VBAK'.
      m_fieldcat 'GT_VBAK' 'WAERK' 'VBAK'.
      m_fieldcat 'GT_VBAP' 'POSNR' 'VBAP'.
      m_fieldcat 'GT_VBAP' 'MATNR' 'VBAP'.
      m_fieldcat 'GT_VBAP' 'NETWR' 'VBAP'.
      m_fieldcat 'GT_VBAP' 'WAERK' 'VBAP'.
      m_sort 'GT_VBAK' 'KUNNR'.
      m_sort 'GT_VBAP' 'NETWR'.
      ls_keyinfo-header01 = 'VBELN'.
      ls_keyinfo-item01 = 'VBELN'.
      CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
           EXPORTING
                i_callback_program      = sy-cprog
                i_callback_user_command = 'USER_COMMAND'
                is_layout               = ls_layout
                it_fieldcat             = lt_fieldcat
                it_sort                 = lt_sort
                i_tabname_header        = 'GT_VBAK'
                i_tabname_item          = 'GT_VBAP'
                is_keyinfo              = ls_keyinfo
           TABLES
                t_outtab_header         = gt_vbak
                t_outtab_item           = gt_vbap
           EXCEPTIONS
                program_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.
    ENDFORM.                               " F_LIST_DISPLAY
          FORM USER_COMMAND                                             *
    FORM user_command USING i_ucomm     LIKE sy-ucomm
                            is_selfield TYPE slis_selfield.     "#EC CALLED
      CASE i_ucomm.
        WHEN '&IC1'.                       " Pick
          CASE is_selfield-tabname.
            WHEN 'GT_VBAP'.
            WHEN 'GT_VBAK'.
              READ TABLE gt_vbak INDEX is_selfield-tabindex.
              IF sy-subrc EQ 0.
              Sales order number
                SET PARAMETER ID 'AUN' FIELD gt_vbak-vbeln.
              Display Sales Order
                CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN.
              ENDIF.
          ENDCASE.
      ENDCASE.
    ENDFORM.                               " USER_COMMAND
    Regards,
    Joy.

  • Macros

    what is the use of macros in abap,how we have to work with them.

    If you want to reuse the same set of statements more than once in a program, you can include them in a macro. For example, this can be useful for long calculations or complex WRITE statements. You can only use a macro within the program in which it is defined, and it can only be called in lines of the program following its definition.
    The following statement block defines a macro macro:
    DEFINE makro.
       statements
    END-OF-DEFINITION.
    REPORT demo_mod_tech_macros.
    DATA: result TYPE i,
          n1     TYPE i VALUE 5,
          n2     TYPE i VALUE 6.
    DEFINE operation.
      result = &1 &2 &3.
      output   &1 &2 &3 result.
    END-OF-DEFINITION.
    DEFINE output.
      write: / 'The result of &1 &2 &3 is', &4.
    END-OF-DEFINITION.
    operation 4 + 3.
    operation 2 ** 7.
    operation n2 - n1.
    This produces the following output:
    The result of 4 + 3 is          7
    The result of 2 ** 7 is        128
    The result of N2 - N1 is          1
    In this example, the two macros operation and output are defined. output is nested in operation. operation is called three times with different parameters. Note how the placeholders &1, &2,... are replaced in the macros.
    The following example shows that a macro definition only works in the program lines following its definition. Do not copy it!
    Let us have a look at a program with a subroutine test:
    PROGRAM macro_test.
    FORM test.
      WRITE '...'.
    ENDFORM.
    We can rewrite the program by introducing a macro macro:
    PROGRAM macro_test.
    FORM test.
    DEFINE macro.
        WRITE '...'.
      ENDFORM.
    END-OF-DEFINITION.
    MACRO.
    Inserting the macro changes nothing in the generated form of the program. Processing blocks - here a subroutine - are always indivisible. We could also write the program as follows:
    PROGRAM macro_test.
    DEFINE macro.
        WRITE '...'.
      ENDFORM.
    END-OF-DEFINITION.
    FORM test.
    MACRO.
    The most essential feature of a macro definition is that it should occur before the macro is used.
    regards
    Giridhar

  • How to write macro.

    hi all,
         i want to write one macro in my function module for selecting data from one table and give back to the function module.
    how to code that and how to call in fm. i dont no anything about macro.
    please help me.
    thanks in advance.
    vinod

    Macro Add-Range Definition
    define add-range.
      &3-sign   = &1.
      &3-option = &2.
      &3-low    = &4.
      &3-high   = &5.
      append &3.
    end-of-definition.
    Macro Implementation
        add-range 'I' 'EQ' w_allc_n w_allc ' '.
    <b><u>See the documentation below.</u></b>
    DEFINE
    Basic form
    DEFINE macro.
    Effect
    Defines a section of source code (macro) that you can address using the name macro. Source code saved as a DEFINE macro may only consist of complete ABAP statements
    All macro use is expanded fully in translation. Macros are a text substitute for the translation phase - not a modularization technique for runtime use.
    You conclude a macro with the END-OF-DEFINITION statement.
    When you define a macro, you can use placeholders (&n, where n = 1, 2, ..., 9). When the macro is expanded, &n is replaced with the n-th current parameter.
    Example
    Suppose you define a macro "INCREMENT", which you then use in your program.
    DEFINE INCREMENT.
      ADD 1 TO &1.
    END-OF-DEFINITION.
    DATA: NUMBER TYPE I VALUE 1.
    INCREMENT NUMBER.
    Notes
    As a rule, you should use subroutines (FORM, FUNCTION) instead of macros. This is because subroutines - unlike macros - are supported by all of the ABAP Workbench tools (debugging, runtime analysis, runtime error handling, ...).
    You cannot define a macro within a macro using the DEFINE statement.
    You cannot use an ABAP keyword as a macro name.
    The validity of a macro definition is determined by its position in the source code. You can use a given macro in any line of code following its definition. There is no distinction between global and local macros. For example, the fact that a macro is defined within a subroutine has no effect on its validity.
    If you redefine a macro, that is, assign a new meaning to an existing name, the new meaning takes effect from the position in the program where the macro was redefined.
    Regards
    Pratyusha
    Message was edited by:
            Pratyu Usha

  • Wat is macro?

    hi friends
              what is the definitions of Macro, Events, Sub routines in abap and can you give some examples for the above mentioned

    Hai      mahesh kumar ,
    Macros
    If you want to reuse the same set of statements more than once in a program, you can include them in a macro. For example, this can be useful for long calculations or complex WRITE statements. You can only use a macro within the program in which it is defined, and it can only be called in lines of the program following its definition.
    The following statement block defines a macro <macro>:
    DEFINE <macro>.
       <statements>
    END-OF-DEFINITION.
    You must specify complete statements between DEFINE and END-OF-DEFINITION. These statements can contain up to nine placeholders (&1, &2, ..., &9). You must define the macro before the point in the program at which you want to use it.
    Macros do not belong to the definition part of the program. This means that the DEFINE...END-OF-DEFINITION block is not interpreted before the processing blocks in the program. At the same time, however, macros are not operational statements that are executed within a processing block at runtime. When the program is generated, macro definitions are not taken into account at the point at which they are defined. For this reason, they do not appear in the overview of the structure of ABAP programs.
    A macro definition inserts a form of shortcut at any point in a program and can be used at any subsequent point in the program. As the programmer, you must ensure that the macro definition occurs in the program before the macro itself is used. Particular care is required if you use both macros and include programs, since not all include programs are included in the syntax check (exception: TOP include).
    To use a macro, use the following form:
    <macro> [<p1> <p2> ... <p9>].
    When the program is generated, the system replaces <macro> by the defined statements and each placeholder &i by the parameter <p i >. You can use macros within macros. However, a macro cannot call itself.
    DATA: RESULT TYPE I,
    N1 TYPE I VALUE 5,
    N2 TYPE I VALUE 6.
    DEFINE OPERATION.
       RESULT = &1 &2 &3.
    OUTPUT &1 &2 &3 RESULT.
    END-OF-DEFINITION.
    DEFINE OUTPUT.
       WRITE: / 'The result of &1 &2 &3 is', &4.
    END-OF-DEFINITION.
    OPERATION 4 + 3.
    OPERATION 2 ** 7.
    OPERATION N2 - N1.
    The produces the following output:
    The result of 4 + 3 is 7
    The result of 2 ** 7 is 128
    The result of N2 - N1 is 1
    Here, two macros, OPERATION and OUTPUT, are defined. OUTPUT is nested in OPERATION. OPERATION is called three times with different parameters. Note how the placeholders &1, &2, ... are replaced in the macros.
    The following example shows that a macro definition only works in the program lines following its definition. Do not copy it!
    Suppose we have a program with a subroutine TEST:
    PROGRAM MACRO_TEST.
    FORM TEST.
      WRITE '...'.
    ENDFORM.
    Suppose we then changed the program to the following:
    PROGRAM MACRO_TEST.
    FORM TEST.
    DEFINE MACRO.
        WRITE '...'.
      ENDFORM.
    END-OF-DEFINITION.
    MACRO.
    Inserting the macro changes nothing in the generated form of the program. Processing blocks - here a subroutine - are always indivisible. We could also write the program as follows:
    PROGRAM MACRO_TEST.
    DEFINE MACRO.
        WRITE '...'.
      ENDFORM.
    END-OF-DEFINITION.
    FORM TEST.
    MACRO.
    The most essential feature of a macro definition is that it should occur before the macro is used.
    Subroutines
    Subroutines are procedures that you can define in any ABAP program and also call from any program. Subroutines are normally called internally, that is, they contain sections of code or algorithms that are used frequently locally. If you want a function to be reusable throughout the system, use a function module.
    FORM <subr> [USING   ... [VALUE(]<pi>[)] [TYPE <t>|LIKE <f>]... ]
                [CHANGING... [VALUE(]<pi>[)] [TYPE <t>|LIKE <f>]... ].
    ENDFORM.
    You call subroutines using the statement
    PERFORM... [USING   ... <pi>... ]
                           [CHANGING... <pi>... ].
    Subroutines can call other subroutines (nested calls) and may also call themselves (recursive calls). Once a subroutine has finished running, the calling program carries on processing after the PERFORM statement. You can use the USING and CHANGING additions to supply values to the parameter interface of the subroutine.
    <subr> is the name of the subroutine. The optional additions USING and CHANGING define the parameter interface. Like any other processing block, subroutines cannot be nested. You should therefore place your subroutine definitions at the end of the program, especially for executable programs (type 1). In this way, you eliminate the risk of accidentally ending an event block in the wrong place by inserting a FORM...ENDFORM block.

  • How to list  macronames in the macro books

    In APO I have a lot of macroes and in a lot of macro books.
    Now a want to have a list of all my macroes.
    How do I do that?

    Hi Per
    You can find data views and defined macros in the following tables;
    /SAPAPO/PBDVW      Existing data views for a planning book
    /SAPAPO/ADVM                     Advanced Macros: Definition Views
    /SAPAPO/AMAKR_TX                 Descriptions of Advanced Macros
    It's not perfect, but you may be able to make a query from this - or use excel to combine.
    BR
    Søren

  • Macro Issue

    Hello,
    I am writing one report, in which I am using macors.
    Macro definition
    define _sel.
    select-options: &1 for &2.
    end-of-definition.
    loop at lt_dfies into ls_dfies.
    For testing purposes,
    concatenate ls_dfies-tabname ls_dfies-fieldname into lv_field separated by '-'.
    sel lvsel lv_field.
    endloop.
    when i check this code.. it says lv_sel is already declared, whereas it is not ?
    can you tell me where the error is ?
    I have made sure that there is NO Include in the report and there is no place the data has been declared ...
    any pointers if we have to do something special with macro's

    Before the program execute, macro is resolved once and only once as
    SELECT-OPTIONS LV_SEL FOR LV_FIELD.
    Try to execute in debug, you will get a select-options parameter at the beginning of your program.
    Abap doesn't resolve this declaration dynamically.
    If you want to dynamically set select-options, look at <a href="http://sap.ittoolbox.com/code/archives.asp?i=10&d=3038&a=s">Source: Dynamic Table Maintenance (enhanced)</a>, there you will find a program which maintain a table dynamically defined with denamic selections like in logical database.
    Regards

  • Macro argument

    How do I create arguments in macro? I know how to call the macro and send in argument in LabView, but how do you create the argument in Excel macro? Thanks.

    Just define the data type as an Integer instead. When you wire an input the the Arg1 terminal, Excel will pass it as a Variant and determine the type using the Macro definition.
    Sub DeleteSheet(intSheetIndex As Integer)
    If intSheetIndex <= Sheets.Count Then
    Application.DisplayAlerts = False
    Sheets(intSheetIndex).Delete
    Application.DisplayAlerts = True
    End If
    End Sub
    Michael Munroe
    www.abcdefirm.com
    Michael Munroe, ABCDEF
    Certified LabVIEW Developer, MCP
    Find and fix bad VI Properties with Property Inspector

  • Compiler and Macros

    Hi, Guys
    I need a favour. As we know when we compile a complex C or C++ code to executable, macro definition is much more important to make thing work.
    In my understanding compiler get macros from in four levels such:
    1.Internal (default) macros definition. (system macros)
    2.Shell environment variables (we can set in profile and retrieve it by env command)
    3.Description file macro definition (we can define iti in **.c, **.cc or **.h and Makefile)
    4.Command line macro definition (similar with Makefile or when we call make pass parameters in)
    Some time when I try compile a cc or c file to executable, we don't know which macros in environment, I know how to check shell variables and others. but we don't know which macros were defined in system, ie we don't know internal (default) macros.
    How I can get internal (default) macros information with C++ or C programming?
    Best regards
    Cidy

    This piece of code (from md6) also can't be compiled for the same reason. And there are no spaces after "\"
    #define loop_body(rs,ls,step)               \
          x = S;                                \
          x ^= A[i+step-t5];                    /* end-around feedback   */ \
          x ^= A[i+step-t0];                    /* linear feedback       */ \
          x ^= ( A[i+step-t1] & A[i+step-t2] ); /* first quadratic term  */ \
          x ^= ( A[i+step-t3] & A[i+step-t4] ); /* second quadratic term */ \
          x ^= (x >> rs);                       /* right-shift           */ \
          A[i+step] = x ^ (x << ls);            /* left-shift            */  
    /* ***************************************************************** */It compiles with gcc though. It seems that "\" isn't supported in sun compiler.

Maybe you are looking for

  • Can we share apps and songs with two different apple IDs but the same computer?

    we both got an iPod Touch for Christmas and we have two seperate Apple IDs and I cant figure out if the music she has purchased and the music i have purchased can be combined. We are using the same computer (windows 7) and same user acct. We also hav

  • How to populate structure through container in workflow?

    Hi experts,     i am new to workflow. i have requirement for getting multiple records in structure. so i am using bapi 'SAP_WAPI_WRITE_CONTAINER'. i have created container which contains multiline records, but i am not able pass the value to structur

  • Please send me some interview quetions in ALE /IDOC's

    please send me some interview qutions in ALE /IDOC'c  it will help me a lot

  • FCC ERROR in Receiver CC

    Hi Experts i am facing the following error in the Receiver File Adapter . I am using the FCC for both the Sender and also teh Receiver. Conversion initialization failed: java.lang.Exception: java.lang.Exception: Error(s) in XML conversion parameters

  • Validation provider in CSV GTC in OIM

    Hi, We are trying to restrict status code coming from the feed file to 0,1,2,3 only. So, I am including a validation check - "Is in Range" and provide max limit as '3' and min limit as '0' and data type as 'integer'. But even if I provide status code