Skip to Content

I’ve been working as an SAP developer for quite some time, and there’s something I always have seen and do, and that’s write a lot of code. For example, when i create a selection screen I have to type code for every parameter, is very reasonable when it’s a single screen, but imagine when are several screens, it becomes a laborious task, which consumes a lots of hours of development. One posible solution is in some way automatize the code generation, and avoid type code and save time.

The same problem of write code several times happens to me when i call modules functions or standard bapis, the workbench tool provides me the Pattern, witch generates the code for the function call.

!https://lh3.googleusercontent.com/nEOT2GS36RnXSFKKSxJfjBwgrD8JjePerRXj0ot-zm-C2wVNsVjGA4liwDjRTx3zpmuguHK6I2nHPfCdj47p8EsO71ARZfQmUtw7N5kz25K2oMHTjg|id=internal-source-marker_0.30956576519822243|height=30px;|alt=|width=575px;|src=https://lh3.googleusercontent.com/nEOT2GS36RnXSFKKSxJfjBwgrD8JjePerRXj0ot-zm-C2wVNsVjGA4liwDjRTx3zpmuguHK6I2nHPfCdj47p8EsO71ARZfQmUtw7N5kz25K2oMHTjg!

!https://lh3.googleusercontent.com/W3JecuO_BZktxw9TbG8UzyWy3k5CH3RI0RqmfmwIoszMVMwxpIf1VaZWdbO-LbBDW8xJ1_TaF5ezV1_jeZvBJTjHOdpnysjifSQocwVrJyR4ElM3cg|id=internal-source-marker_0.30956576519822243|height=359px;|alt=|width=648px;|src=https://lh3.googleusercontent.com/W3JecuO_BZktxw9TbG8UzyWy3k5CH3RI0RqmfmwIoszMVMwxpIf1VaZWdbO-LbBDW8xJ1_TaF5ezV1_jeZvBJTjHOdpnysjifSQocwVrJyR4ElM3cg!

This tool gives me the possibility of assign the variables to the function parameters by myself, witch is and advantage because is flexible, but also is an disadvantage (in my opinion) because i have to assign the variables and declares too for all the parameters.

That’s how I came with the idea to add variables to the corresponding parameters automatically and declare those variables.

!https://lh6.googleusercontent.com/EE8ITMdbJWHD1RJabGuNHR0VyKGGKYg0se2SvtfQTyNFTW8WTevf0lU8VDxYQkAk_Bn3mi0JYmNe7LTtDR2LuoU76smuliNDsP3FgP_eu4DnWMhgwQ|id=internal-source-marker_0.5306231734644039|height=587|alt=|width=654|src=https://lh6.googleusercontent.com/EE8ITMdbJWHD1RJabGuNHR0VyKGGKYg0se2SvtfQTyNFTW8WTevf0lU8VDxYQkAk_Bn3mi0JYmNe7LTtDR2LuoU76smuliNDsP3FgP_eu4DnWMhgwQ!
This is my program, which is in experimental stage n_n, my abapers friends help me with the testing, maybe if you can test it and give me feedback it helps me a lot to make more improvements.

&—-


*& Report  Z_FM_CALL_CODE

*&

&—-


*& Autor: Raúl Vides Mosquera Pumaricra.

*& Lima-Perú 2010.

&—-


REPORT  z_fm_call_code.

CONSTANTS: c_tip_import TYPE c VALUE ‘I’,

          c_tip_export TYPE c VALUE ‘E’,

          c_tip_tables TYPE c VALUE ‘T’.

TYPES: BEGIN OF ty_codigo,

        linea TYPE string,

      END OF ty_codigo.

TYPES ty_tfdir      TYPE STANDARD TABLE OF tfdir.

TYPES ty_tftit      TYPE STANDARD TABLE OF tftit.

TYPES ty_funct      TYPE STANDARD TABLE OF funct.

TYPES ty_enlfdir    TYPE STANDARD TABLE OF enlfdir.

TYPES ty_trdir      TYPE STANDARD TABLE OF trdir.

TYPES ty_fupararef  TYPE STANDARD TABLE OF sfupararef.

TYPES ty_abaptxt255 TYPE STANDARD TABLE OF abaptxt255.

TYPES ty_line(72)   TYPE c.

TYPES ty_line_tab   TYPE STANDARD TABLE OF ty_line.

TYPES swbse_max_line(255) TYPE c.

TYPES swbse_max_line_tab  TYPE TABLE OF swbse_max_line.

TYPES:  BEGIN OF ty_variable,

         tipo_var      TYPE c,

         identificador TYPE string, “char30,                        “char25,

         pertenece_a   TYPE char30,

         tipo_dato     TYPE rs38l_typ,

         tipo_tabla    TYPE c,

         instancia     TYPE char15,

         valor         TYPE char30,

         cod_mod       TYPE numc5,

         in_out        TYPE c,

         traspaso      TYPE c, “Ref o Value

         optional      TYPE c,

         param_origina TYPE char30,

       END OF ty_variable.

TYPES:  BEGIN OF ty_parametro_cant,

         parameter TYPE char30,

         cant      TYPE i,

       END OF ty_parametro_cant.

TYPES:  BEGIN OF ty_modulos,

         cod_mod       TYPE numc5,

         tipo_mod      TYPE c, “Form o Metodo

         identificador TYPE char30,

         pertenece_a   TYPE char30,

         metodo_event  TYPE char30,

         clase_event   TYPE char30,

       END OF ty_modulos.

DATA it_codigo TYPE STANDARD TABLE OF ty_codigo.

  • Parameters

DATA it_import     TYPE STANDARD TABLE OF rsimp.       “Importing

DATA it_change     TYPE STANDARD TABLE OF rscha.       “Changing

DATA it_export     TYPE STANDARD TABLE OF rsexp.       “Exporting

DATA it_tables     TYPE STANDARD TABLE OF rstbl.       “Tables

DATA it_except     TYPE STANDARD TABLE OF rsexc.       “Exception

DATA it_param_docu TYPE STANDARD TABLE OF rsfdo.

DATA it_ptfdir     TYPE ty_tfdir.

DATA it_ptftit     TYPE ty_tftit.

DATA it_pfunct     TYPE ty_funct.

DATA it_penlfdir   TYPE ty_enlfdir.

DATA it_ptrdir     TYPE ty_trdir.

DATA it_pfupararef TYPE ty_fupararef.

DATA it_uincl      TYPE ty_abaptxt255.

DATA it_variables  TYPE STANDARD TABLE OF ty_variable.

DATA it_parametro_cant TYPE STANDARD TABLE OF ty_parametro_cant.

DATA w_funcname    TYPE rs38l_fnam.

DATA it_lines      TYPE ty_line_tab.

DATA w_offset      TYPE i.

DATA w_max_offset  TYPE i.

DATA wa_lines      LIKE LINE OF it_lines.

PARAMETER p_func TYPE rs38l_fnam OBLIGATORY.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_func.

CALL FUNCTION ‘RS_HELP_HANDLING’

   EXPORTING

     dynpfield                 = ‘P_FUNC’

     dynpname                  = sy-dynnr

     object                    = ‘FB’

     progname                  = ‘SAPMS38L’

     suppress_selection_screen = ‘X’.

START-OF-SELECTION.

DATA rep               TYPE swbse_max_line_tab.

w_funcname = p_func.

REFRESH: it_import, it_change, it_export,

          it_tables, it_except, it_param_docu.

PERFORM fu_import_interface_ext(sapms38l)

                            TABLES it_import

                                   it_change

                                   it_export

                                   it_tables

                                   it_except

                                   it_param_docu

                             USING w_funcname.

REFRESH: it_ptfdir,   it_ptftit, it_pfunct,

          it_penlfdir, it_ptrdir, it_pfupararef,

          it_uincl.

PERFORM func_get_object USING w_funcname

                      CHANGING it_ptfdir

                               it_ptftit

                               it_pfunct

                               it_penlfdir

                               it_ptrdir

                               it_pfupararef

                               it_uincl.

REFRESH it_parametro_cant.

CLEAR: w_offset, w_max_offset.

PERFORM get_max_longitud_fm_param    USING c_tip_tables

                                   CHANGING w_offset.

w_max_offset = w_offset.

CLEAR w_offset.

PERFORM get_max_longitud_fm_param    USING c_tip_export

                                   CHANGING w_offset.

IF w_offset GT w_max_offset.

   w_max_offset = w_offset.

ENDIF.

CLEAR w_offset.

PERFORM get_max_longitud_fm_param    USING c_tip_import

                                   CHANGING w_offset.

IF w_offset GT w_max_offset.

   w_max_offset = w_offset.

ENDIF.

PERFORM generar_variables USING ‘I’.

PERFORM generar_variables USING ‘E’.

PERFORM generar_variables USING ‘T’.

PERFORM evitar_parametros_repetidos.

PERFORM codigo_declaracion_variable.

PERFORM generar_llamado_fm    USING w_funcname

                            CHANGING rep.

FIELD-SYMBOLS .

ENDLOOP.

*&—-


*&      Form  get_max_longitud_fm_param

*&—-


  •       Obtiene la máxima longitud de los nombres de los parámetros.

*—-


  • –>  w_tipo_param        Tipo de parámetro

  • <–  w_length_o          Longitud máxima

*—-


FORM get_max_longitud_fm_param    USING value(w_tipo_param) TYPE c

                              CHANGING value(w_length_o)   TYPE i.

DATA w_length    TYPE i.

DATA w_campo     TYPE char30.

DATA w_itab_name TYPE char30.

DATA wa_parametro_cant LIKE LINE OF it_parametro_cant.

FIELD-SYMBOLS .

ENDFORM.                    ” get_max_longitud_fm_param

*&—-


*&      Form  get_nombre_parametro

*&—-


  •       Obtiene en nombre del parámetro

*—-


  • –>  w_tipo_param        (I)mport, (E)xport (T)ables

  • <–  w_itab_name         Nombre de tabla interna

*—-


FORM get_nombre_parametro USING value(w_tipo_param) TYPE c

                      CHANGING value(w_itab_name)  TYPE char30.

CASE w_tipo_param.

   WHEN c_tip_import. “Import

     w_itab_name = ‘it_import’.

   WHEN c_tip_export. “Export

     w_itab_name = ‘it_export’.

   WHEN c_tip_tables. “Tables

     w_itab_name = ‘it_tables’.

ENDCASE.

ENDFORM.                    ” get_nombre_parametro

*&—-


*&      Form  get_patron_para_declaracion

*&—-


  •       text

*—-


  • –>  wa_fs_fm

  • –>  w_tipo_param        text

  • <–  w_var               text

  • <–  w_tipo_dato

  • <–  w_tipo_s

*—-


FORM get_patron_para_declaracion USING value(wa_fs_fm)     TYPE any

                                      value(w_tipo_param) TYPE c

                             CHANGING value(w_var)        TYPE string

                                      value(w_tipo_dato)  TYPE string

                                      value(w_tipo_s)     TYPE char10.

DATA w_campo TYPE char30.

FIELD-SYMBOLS -typ’.

     ENDIF.

   WHEN c_tip_tables. “Tables

     w_var       = ‘it_[NOMBRE]’.

     w_tipo_dato = ‘STANDARD TABLE OF ‘.

     w_campo     = ‘.

ENDFORM.                    ” get_patron_para_declaracion

&—-


*&      Form  GENERAR_LLAMADO_FM

&—-


  •       Genera el código de llamado de la FM.

  •       Nota: tomado del método standard METH_ED_GENERATE_CALL

  •       de la clase CL_FB_FUNCTION_UTILITY.

—-


  • –>  funcname        Nombre de la función

  • <–  rep             Código

—-


FORM generar_llamado_fm    USING value(funcname)  TYPE rs38l_fnam

                       CHANGING value(rep)       TYPE swbse_max_line_tab.

DATA: BEGIN OF func,

           fu1  TYPE c VALUE ””,

           name TYPE rs38l-name,

           fu2  TYPE c VALUE ””,

       END OF func.

DATA: BEGIN OF ip,

        ip1 TYPE c VALUE ‘I’,

        num(2),

       END OF ip.

DATA: BEGIN OF ep,

        ep1 TYPE c VALUE ‘E’,

        num(2),

       END OF ep.

DATA: BEGIN OF tp,

        tp1 TYPE c VALUE  ‘T’,

        num(2),

       END OF tp.

DATA: incl           TYPE rs38l-include,

       length         TYPE i,

       lengt2         TYPE i,

       max            TYPE p,

       l_com_line     TYPE i,

       l_lines        TYPE i,

       mit_try_endtry TYPE c,

       l_obli         TYPE c.

DATA  w_lengt_aux    TYPE i.

CONSTANTS: type_ins TYPE i VALUE 2,

            parm_ins TYPE i VALUE 4.

DATA: num TYPE i.

FIELD-SYMBOLS  LIKE LINE OF it_variables.

  • E. Crasovan:  Work-area’s  wg. OO definiert

DATA w_enlfdir     TYPE enlfdir.

DATA w_p_if_import TYPE rsimp.

DATA w_p_if_export TYPE rsexp.

DATA w_p_if_change TYPE rscha.

DATA w_p_if_tables TYPE rstbl.

DATA w_p_if_except TYPE rsexc.

DATA w_rep         TYPE swbse_max_line.

DATA l_rseumod     TYPE rseumod.

DATA l_fbpattern   TYPE fbpattern.

FIELD-SYMBOLS  LIKE LINE OF it_except.  “I-RMP

*

CALL FUNCTION ‘RS_WORKBENCH_CUSTOMIZING’

   EXPORTING

     choice          = ‘EW’

     suppress_dialog = ‘X’

   IMPORTING

     setting         = l_rseumod.

  • E. Crasovan: exten3 sagt aus ob der FB mit Exceptionklassen arbeitet

CLEAR l_fbpattern.

MOVE-CORRESPONDING l_rseumod TO l_fbpattern.

mit_try_endtry = l_fbpattern-with_try_endtry.

SELECT SINGLE exten3 FROM enlfdir INTO w_enlfdir-exten3

WHERE funcname = funcname.

  • Die ganze Logik hier ist eigentlich die Form ed_generate_call_new

*

CLEAR length.

LOOP AT it_import ASSIGNING -exception ).

   IF lengt2 GT length.

     length = lengt2.

   ENDIF.

ENDLOOP.

IF length LT 7.

   length = 7.

ENDIF.

lengt2 = length + 13.

length = length + 11.

  • E. Crasovan

  • Wenn mit Exceptionklassen gearbeitet wird, soll der Aufruf des FB’s in einem

  • TRY … ENDTRY Block eingeschlossen werden.

CLEAR: w_rep.

*

  • Achtung, hier wird entschieden ob TRY…CATCH…ENTRY verwendet wird oder nicht!!!

  • Sollte TRY…ENTRY doch erscheinen, dann mit_try_endry auf NICHT INITIAL setzen.

IF NOT w_enlfdir-exten3 IS INITIAL.

   IF NOT mit_try_endtry IS INITIAL.

     w_rep = ‘TRY.’.

     APPEND w_rep TO rep.

     CLEAR w_rep.

   ENDIF.

ENDIF.

w_rep = ‘CALL FUNCTION’.

func-name = funcname.

CONDENSE func NO-GAPS.

w_rep+20 = func.

CONDENSE w_rep.

APPEND w_rep TO rep. CLEAR w_rep.

*

CLEAR: l_com_line.

l_obli = ‘X’.

LOOP AT it_import ASSIGNING -parameter.

   w_lengt_aux = 255 – length.              “I-RMP

  •    ASSIGN w_rep+length(1) TO <f>.          “D-RMP

   ASSIGN w_rep+length(w_lengt_aux) TO  = ‘=’.

  •   Inicio RMP

   READ TABLE it_variables ASSIGNING  SEPARATED BY space.

   ENDIF.

  •   Fin    RMP

   IF NOT .

  •      <f> = ‘”‘. “D-RMP

     .

  •          <f> = ”’ ”’. “D-RMP

       ELSE.

         ASSIGN w_rep+lengt2(28) TO .

  •      <f> = ‘”‘. “D-RMP

   .

  •      <f> = ‘”‘. “D-RMP

     -parameter.

   w_lengt_aux = 255 – length.              “I-RMP

  •    ASSIGN w_rep+length(1) TO <f>.          “D-RMP

   ASSIGN w_rep+length(w_lengt_aux) TO  = ‘=’.

  •   Inicio RMP

   READ TABLE it_variables ASSIGNING  SEPARATED BY space.

   ENDIF.

  •   Fin    RMP

   IF l_fbpattern-formal_eq_actual .

  •      <f> = ‘”‘. “D-RMP

   -parameter.

  •    ASSIGN w_rep+length(1) TO <f>.          “D-RMP

   ASSIGN w_rep+length(w_lengt_aux) TO  = ‘=’.

  •   Inicio RMP

   READ TABLE it_variables ASSIGNING  SEPARATED BY space.

   ENDIF.

  •   Fin    RMP

   IF l_fbpattern-formal_eq_actual -optional IS INITIAL.

  •      w_rep(1) = ‘”‘.   “D-RMP

     w_rep(1) = ‘*’.   “I-RMP

     IF l_obli = ‘X’.

       CLEAR l_obli.

     ENDIF.

   ELSE.

     l_obli = ‘1’.

   ENDIF.

   APPEND w_rep TO rep. CLEAR w_rep.

ENDLOOP.

IF l_obli IS INITIAL.

   READ TABLE rep INDEX l_com_line INTO w_rep.

   ASSIGN w_rep(1) TO .

  •      <f> = ‘”‘. “D-RMP

   .

  •      <f> = ‘”‘. “D-RMP

     .

  •      <f> = ‘”‘. “D-RMP

    = ‘*’. “I-RMP

   MODIFY rep FROM w_rep INDEX l_com_line.

   CLEAR w_rep.

ENDIF.

*

  • E. Crasovan

  • Wenn mit Exceptionklassen gearbeitet wird, soll der Aufruf des FB’s in einem

  • TRY … ENDTRY Block eingeschlossen werden.

*

*

IF NOT w_enlfdir-exten3 IS INITIAL.

   CLEAR w_rep.

   w_rep+10 = ‘.’.

   APPEND w_rep TO rep.

*

   IF NOT mit_try_endtry IS INITIAL.

     DESCRIBE TABLE it_except LINES l_lines.

     IF NOT l_lines IS INITIAL.

       LOOP AT it_except ASSIGNING -exception ‘.’ INTO w_rep.

         w_rep+5(1) = space.

         APPEND w_rep TO rep.

         CLEAR w_rep.

       ENDLOOP.

     ENDIF.

*

     w_rep = ‘ENDTRY.’.

     APPEND w_rep TO rep.

     CLEAR w_rep.

   ENDIF.

ELSE.

  • dieser Teil kommt aus ed_generate_call_new

   DESCRIBE TABLE it_except LINES l_lines.

   IF NOT l_lines IS INITIAL.

  •      w_rep = ‘”‘.      “D-RMP

     w_rep = ‘*’.      “I-RMP

     w_rep+type_ins = ‘EXCEPTIONS’.

     APPEND w_rep TO rep. CLEAR w_rep.

     LOOP AT it_except ASSIGNING .

  •        <f> = ‘”‘.       “D-RMP

        = num.

       APPEND w_rep TO rep. CLEAR w_rep.

     ENDLOOP.

     IF l_fbpattern-exc_wo_others = space.

       num = num + 1.

  •      w_rep = ‘”‘.      “D-RMP

       w_rep = ‘*’.      “I-RMP

       w_rep+parm_ins = ‘OTHERS’.

       ASSIGN w_rep+length(1) TO .

  • Wegen zu starken Moserns der Anwendung wieder ausgebaut

  • if num = 1.

    •   Keine Exception vorhanden, wegen des SLIN auf 0 abbilden.

  •    num = 0.

  • endif.

        = num.

       APPEND w_rep TO rep. CLEAR w_rep.

     ENDIF.

   ENDIF.

   CLEAR w_rep.

   w_rep+10 = ‘.’.

   APPEND w_rep TO rep.

*EC’s

ENDIF.

ENDFORM.                    ” GENERAR_LLAMADO_FM

&—-


*&      Form  GENERAR_VARIABLES

&—-


  •       Genera las variables en base a los parámetros de la función

—-


  • –>  w_tipo_param       (I)mport, (E)xport (T)ables

—-


FORM generar_variables USING value(w_tipo_param) TYPE c.

DATA w_itab_name  TYPE char30.

DATA w_var        TYPE string.

DATA w_tipo_dato  TYPE string.

DATA w_tipo_ref   TYPE rs38l_typ.

DATA w_campo      TYPE char30.

DATA w_tipo_s     TYPE char10.

DATA wa_variables LIKE LINE OF it_variables.

FIELD-SYMBOLS -structure.

   ENDIF.

   REPLACE ‘[TIPO]’   IN w_tipo_dato WITH w_tipo_ref.

   wa_variables-tipo_dato     = w_tipo_dato.

   wa_variables-in_out        = w_tipo_param.

   APPEND wa_variables TO it_variables.

ENDLOOP.

ENDFORM.                    ” GENERAR_VARIABLES

&—-


*&      Form  CODIGO_DECLARACION_VARIABLE

&—-


  •       Genera el código acerca de la declaración de variables.

—-


FORM codigo_declaracion_variable .

DATA w_line      TYPE swbse_max_line.

DATA w_line_aux  TYPE swbse_max_line.

FIELD-SYMBOLS .

   w_line  = ‘DATA %[TYPE] .’.

   REPLACE ‘[VAR]’      IN w_line WITH -instancia.

   w_offset = w_max_offset + 9.

   SPLIT w_line AT ‘%’ INTO w_line w_line_aux.

   w_line+w_offset = w_line_aux.

   WRITE / w_line.

ENDLOOP.

ENDFORM.                    ” CODIGO_DECLARACION_VARIABLE

&—-


*&      Form  EVITAR_PARAMETROS_REPETIDOS

&—-


  •       Evita los parámetros repetidos.

—-


FORM evitar_parametros_repetidos .

DATA w_i TYPE n.

FIELD-SYMBOLS -identificador.

   ENDIF.

ENDLOOP.

ENDFORM.                    ” EVITAR_PARAMETROS_REPETIDOS

&—-


*&      Form  FUNC_GET_OBJECT

&—-


  •       FM: FUNC_GET_OBJECT

—-


  • –>  w_funcname        Nombre del módulo de función

  • <–  it_ptfdir

  • <–  it_ptftit

  • <–  it_pfunct

  • <–  it_penlfdir

  • <–  it_ptrdir

  • <–  it_pfupararef

  • <–  it_uincl

—-


FORM func_get_object USING    value(w_funcname)    TYPE rs38l_fnam

                    CHANGING value(it_ptfdir)     TYPE ty_tfdir

                             value(it_ptftit)     TYPE ty_tftit

                             value(it_pfunct)     TYPE ty_funct

                             value(it_penlfdir)   TYPE ty_enlfdir

                             value(it_ptrdir)     TYPE ty_trdir

                             value(it_pfupararef) TYPE ty_fupararef

                             value(it_uincl)      TYPE ty_abaptxt255.

REFRESH: it_ptfdir,   it_ptftit, it_pfunct,

          it_penlfdir, it_ptrdir, it_pfupararef,

          it_uincl.

CHECK w_funcname IS NOT INITIAL.

CALL FUNCTION ‘FUNC_GET_OBJECT’

   EXPORTING

     funcname           = w_funcname

   TABLES

     ptfdir             = it_ptfdir

     ptftit             = it_ptftit

     pfunct             = it_pfunct

     penlfdir           = it_penlfdir

     ptrdir             = it_ptrdir

     pfupararef         = it_pfupararef

     uincl              = it_uincl

   EXCEPTIONS

     function_not_exist = 1

     version_not_found  = 2

     OTHERS             = 3.

ENDFORM.                    ” FUNC_GET_OBJECT

</textarea></p>

To report this post you need to login first.

29 Comments

You must be Logged on to comment or reply to a post.

  1. Raul Vides Mosquera Pumaricra Post author
    Gauri, Ramakrishna, Ivan many thanks for the comments =D, Andrea, did you mean integrate the app with the abap editor?, is a good idea, but, it requires change the standard code. Perhaps there is an user exit for the pattern that i could use it, if you know something let me know.
    (0) 
      1. A. de Smidt
        this looks very promissing especially with bapis

        but perhaps already an extra idea to implement to save even more incredible coding time. just a thought I don’t know if possible.

        with a lot of functions or bapis which you want to reuse from standard sap programms you have the possibility to save testdata during debugging or just save the testdata in se37

        the coding of the variables takes some time but most time is generated with entering all the fields and their values like.

        if those fields who contain data in the testingdata are already declared with their values then you only have to replace the values with their corresponding variables.

        and otherwise an easy way to select the fields from the structures you want to use and copy them in the abap programm with the standard variable name as used above and the fieldname with = .

        a lot of typing is to be done with filling all the variables

        * Standplaats (locations)
          ls_bup-parent_guid = ‘00000000000000000000000000000002’.
          ls_bup-partner_guid = ’40E85BC15AD7006E0200000091640C09′.
          ls_bup-partner_fct = ‘00000075’.
          ls_bup-mainpartner = ‘X’.
          ls_bup-addr_type = ‘1’.
          ls_bup-addr_origin = ‘A’.
          ls_bup-country = ‘NL’.
          ls_bup-name = ‘arthur’.
          ls_bup-partner = ls_locations-partner_no.
          APPEND ls_bup TO lt_bup.

        .

        I will try this construction soon it sure looks promising 🙂

        (0) 
  2. Arshad Ansary
    Halo Raul,

    Thanks for this wonderful tool which I am using frequently in my projects . But when calling certain FMs it dumps (  ASSIGN_LENGTH_0 dump ).

    For eg when i call FM “SEO_INHERITANCE_ROOT_CLASSES” it dumps

    (0) 
  3. Oliver Russinger
    Hi,
    very good blog and good idea.
    we have something similar with some helpfunctions and we integrated a toolbar below the FCodes, which can be easily done with BADI WB_PROCESS_FCODE
    so you could integrate this functionality directly into the editor.
    (0) 
      1. Oliver Russinger
        and the funny thing is , in release 620 (i just checked) there was no field or flag “sap internal use only” , this was invented in a later release.

        hopefully, there will be never aa problem with that *g*

        (0) 
  4. navin c
    Nice tool. i am using this tool nowadays it saves lots of time of mine.
    I appreciate your effort in building this object.

    Regards,
    Navin. C

    (0) 
  5. Krishna Chauhan
    Grt8  work done, It will definately save a lot of time for the developers. I suggest ABAP beginners should avoid using this else they will not learn how to declare variables.
    (0) 
  6. Vinod Kumar
    Hi,

    Very useful developement. One suggestion, can’t we use the Class “CL_FB_FUNCTION_UTILITY”, method “METH_GET_INTERFACE” to get this information without much coding?

    Regards
    Vinod

    (0) 
  7. A. de Smidt
    you inspired me to take this a bit further.

    since not only variables declaration takes a lot of time but also assigning variables to values.
    (with certain bapis I spent most time in writing down all the variables that I need to assign)

    I have quickly written a programm which perhaps explains it better (written within an hour so I know many things can be improved)

    and put it in a wiki
    http://wiki.sdn.sap.com/wiki/display/stage/Generate+multiple+variable+coding+from+structures+or+tables

    The base of the programm is to select the fields you need from a certain structure and then translate it to the appropiate coding.

    kind regards
    Arthur

    (0) 
    1. Raul Vides Mosquera Pumaricra Post author
      Yes!, it´s a very good contribution, the idea of propose the fields of the structure would reduce the time, but I was thinking of searching the references of the fm in all the Z programs to obtain the most used fields, which is more accurate (in my opinion).

      Could you understand me?

      PD: I left a comment in the wiki n_n.

      (0) 
      1. A. de Smidt
        yes I can understand but when you already have z programms of that function you can already copy past most of the coding. most of the programming is with new bapis or functions that are also hardly used by sap.

        that’s why if you run my programm you can select the fields you think you want to use or select them all. standard they are all greyed out.

        if you are also looking into this perhaps an better option is to look at the obligatory fields that are minimal required to run the bapi or function.

        I also commented on my wiki and also added the declaration of the zddfield_alv structure.

        (0) 

Leave a Reply