Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

SO10 - FM to Replace Symbols

Former Member
0 Kudos

hi guys,

i've got a special problem in my variant configuration.

In User-Exit I read the configuration in conf_out structure.

Because of a special characteristic value from configuration i must read a SO10-Standard-Text

to define the variant material:

The characteristic values from the Configuration must replace the Vars in the Standard-Text!

Example for the defined content of standard-text: Z_TEXT1

Value a: &VAR1& x & VAR2&

Value b: &VAR3&

Longtext from User and so on ......

Value c: &VAR4&

My question is: Is there a FM available to substitute the Vars from my configuration?

Thanks a lot.

I will reward points for helpful answers.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Markus.

I suggest you to correct your statement as it can result into locking of your thread,

Markus wrote:

I will reward points for helpful answers.

Hope you do not repeat, take it as a positive suggestion.

Good Luck & Regards.

Harsh Dave.

5 REPLIES 5

Former Member
0 Kudos

Hi Markus,

1. There must a z program which must be calling this

std text.

2. This program must have global variables VAR1, VAR2 etc,

3. Their values will automatically get populated in the std. text.

regards,

amit m.

0 Kudos

>

> Hi Markus,

>

> 1. There must a z program which must be calling this

> std text.

>

>

> 2. This program must have global variables VAR1, VAR2 etc,

>

> 3. Their values will automatically get populated in the std. text.

>

>

> regards,

> amit m.

Hi Amit,

thanks for your reply.

I've tried a Z- FM (SE37) to solve my problem.

The vars are declarated as globals .

But after the FM READ_TEXT -> SO10-standard-text and SAVE_TEXT the vars in the sd-position ain't filled.

Perhaps you'll see my error in the following coding.

CLEAR: name.
    name = 'Z_TYP200_KONF_ALLGEMEIN'.

* Konfiguration auslesen und Werte ersetzen
    IF NOT iconfiguration[] IS INITIAL.
      LOOP AT iconfiguration.
        CASE iconfiguration-atnam.
          WHEN 'NT_OEFFNUNGSBREITE'.
            oeffnungsbreite = iconfiguration-atwrt.
          WHEN 'NT_OEFFNUNGSHOEHE'.
            oeffnungshoehe = iconfiguration-atwrt.
        ENDCASE.

      ENDLOOP.
    ENDIF.

* variantenspezifischer Standardtext mit Variablen eintragen
    CLEAR: it_lines.
    REFRESH: it_lines.

    CALL FUNCTION 'READ_TEXT'
         EXPORTING
             client                  = sy-mandt
              id                      = 'ST'
              language                = sy-langu
              name                    = name
              object                  = 'TEXT'
*         ARCHIVE_HANDLE          = 0
*    IMPORTING
*         HEADER                  =
         TABLES
              lines                   = it_lines
        EXCEPTIONS
             id                      = 1
             language                = 2
             name                    = 3
             not_found               = 4
             object                  = 5
             reference_check         = 6
             wrong_access_to_archive = 7
             OTHERS                  = 8  .

    CLEAR: header.

    header-tdobject  = 'VBBP'.
    CONCATENATE ivbap-vbeln ivbap-posnr INTO header-tdname.
    CONCATENATE 'Konfiguration' ivbap-vbeln
                 '/' ivbap-posnr
                 sy-uname '/' sy-uzeit
                 INTO header-tdtitle SEPARATED BY space.
    header-tdid      = '0001'.
    header-tdspras   = 'DE'.
    header-mandt     = sy-mandt.

*   Text direkt in Materialverkaufstext sichern
    CALL FUNCTION 'SAVE_TEXT'
      EXPORTING
        client                = sy-mandt
        header                = header
        insert                = ' '
        savemode_direct       = 'X'
*     OWNER_SPECIFIED       = ' '
*     LOCAL_CAT             = ' '
*   IMPORTING
*     FUNCTION              =
*     NEWHEADER             =
      TABLES
        lines                 = it_lines
    EXCEPTIONS
      id                    = 1
      language              = 2
      name                  = 3
      object                = 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.

0 Kudos

Hi,

1. Use the FM REPLACE_TEXTSYMBOL

just before save_text.

2. This FM will replace all the &..& variables

with the current values from your program.

regards,

amit m.

0 Kudos

Hello Amit,

I solved the problem by adding an SE11 ztable.

when calling edit_text i call program where i defined my ztable.

thanks and regards.

Markus

Former Member
0 Kudos

Hi Markus.

I suggest you to correct your statement as it can result into locking of your thread,

Markus wrote:

I will reward points for helpful answers.

Hope you do not repeat, take it as a positive suggestion.

Good Luck & Regards.

Harsh Dave.