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: 

Create_Text

Former Member
0 Kudos

Hi experts,

am Using the function module "Create_text" to create the some standard text in the TCode  "SO10" but its falling to create . also am using the commit function to it.

note : while debugging i found that internal commit is available for this FM but still am using external commit FM still its falling.

If i run the same FM in se37 itself by giving the same data it is creating the STD text on the above tcode but failing to create inside the program.

below i attached the sample code with the FM "Create_text" please take a look and let me know where am doin the mistake...

{Code}

DATA: lt_string TYPE STANDARD TABLE OF tline.

DATA: lv_comit TYPE sy-index.

CALL FUNCTION 'CREATE_TEXT'

   EXPORTING

     fid         = 'ST'

     flanguage   = 'E'

     fname       = 'ZTES'

     fobject     = 'TEXT'

     save_direct = 'X'

     fformat     = '*'

   TABLES

     flines      = lt_string.

 

IF sy-subrc = 0.

   WRITE: ' FM sucessful'.

ELSE.

   WRITE: 'FM error'.

ENDIF.

CALL FUNCTION 'COMMIT_TEXT'

   EXPORTING

     object          = 'TEXT'

     name            = 'ZTES'

     id              = 'ST'

     language        = 'E'

     savemode_direct = 'X'

     keep            = 'X'

*   LOCAL_CAT       = ' '

   IMPORTING

     commit_count    = lv_comit.

*       TABLES

*         T_OBJECT              =

*         T_NAME                =

*         T_ID                  =

*         T_LANGUAGE            =

.

 

IF sy-subrc = 0.

   WRITE: / lv_comit.

ELSE.

   WRITE: 'commit error'.

* Implement suitable error handling here

ENDIF.

{code}

for the above code is not returning any error. but also its giving lv_comit = 0. means nothing is got commited

pleaselet me know where am doing the mistake.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

note: for the above code without the external commit FM also its falling.

11 REPLIES 11

Former Member
0 Kudos

note: for the above code without the external commit FM also its falling.

0 Kudos

Add some value in lt_string(Should not be empty) and pass them in CREATE_TEXT.

TABLES

     flines      = lt_string.

0 Kudos

Hai Roy,

for Lt_string am passing value in my real code. here i posted just a sample code...

if the lt_string has some value also it is failling....

0 Kudos

plaese try the above same code by passing some value to that LT_STRING  table and let me know its works for you...

i tried its not working... 😞

0 Kudos

I just tested it in my system . After passing flines in CREATE_TEXT it creates the standard text perfectly . You don't need the COMMIT_TEXT also.

DATA: lt_string TYPE STANDARD TABLE OF tline.

DATA: lv_comit TYPE sy-index.

DATA : wa_lines TYPE LINE OF tlinetab.

wa_lines-tdformat = '*'.

wa_lines-tdline = 'Test'.

APPEND wa_lines TO lt_string.

CALL FUNCTION 'CREATE_TEXT'

   EXPORTING

     fid         = 'ST'

     flanguage   = 'E'

     fname       = 'ZTES'

     fobject     = 'TEXT'

     save_direct = 'X'

     fformat     = '*'

   TABLES

     flines      = lt_string.

IF sy-subrc = 0.

   WRITE: ' FM sucessful'.

ELSE.

   WRITE: 'FM error'.

ENDIF.


rosenberg_eitan
Active Contributor
0 Kudos

Hi,

I am using functions:

CALL FUNCTION 'READ_TEXT' 

CALL FUNCTION 'SAVE_TEXT'

Those functions are released and well documented .

I do not see CREATE_TEXT function here.


Regards.

0 Kudos

Hi Eitan,

so to create the STD text on the Tcode 'SO10 ' which FM will you prefer to use???

please let me know ..

0 Kudos

Hai Eitan,

for the FM create_text we have the value in the table TFDIR . It means this FM is also released.

please correct me if am wrong.

0 Kudos

0 Kudos

Hi,

SAVE_TEXT to create/update.

Regards

Former Member
0 Kudos

thanks a lot ROY!!!!!

the mistake i did is ....

am passing the Fname to one variable and then assigning that variable to the function module like below

CALL FUNCTION 'CREATE_TEXT'

   EXPORTING

     fid         = 'ST'

     flanguage   = 'E'

     fname       = lv_fname

     fobject     = 'TEXT'

     save_direct = 'X'

     fformat     = '*'

   TABLES

     flines      = lt_string.



the problem is lv_fname value is in lower case letter so its failling to create .... now i changed that to upper case when it assigning to the variable then its working fine....


thanks roy again....