10-26-2015 10:47 AM
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.
10-26-2015 10:51 AM
note: for the above code without the external commit FM also its falling.
10-26-2015 10:51 AM
note: for the above code without the external commit FM also its falling.
10-26-2015 11:02 AM
Add some value in lt_string(Should not be empty) and pass them in CREATE_TEXT.
TABLES
flines = lt_string.
10-26-2015 11:06 AM
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....
10-26-2015 11:11 AM
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... 😞
10-26-2015 11:14 AM
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.
10-26-2015 11:03 AM
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.
10-26-2015 11:08 AM
Hi Eitan,
so to create the STD text on the Tcode 'SO10 ' which FM will you prefer to use???
please let me know ..
10-26-2015 11:16 AM
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.
10-26-2015 3:12 PM
10-26-2015 3:13 PM
10-26-2015 11:54 AM
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....