Standard text FM



DATA:
        L_F_TDNAME 
TYPE TDOBNAME,
        L_S_THEAD  
TYPE THEAD.

  L_S_THEAD
-TDOBJECT   G_C_PMS."PMS
  L_S_THEAD
-TDID       G_C_ID ."LTXT
  L_S_THEAD
-TDSPRAS    SY-LANGU.
  L_S_THEAD
-TDLINESIZE G_C_LSIZE.
  L_S_THEAD
-TDTXTLINES G_C_LINES.
  L_F_TDNAME 
P_G_F_OBJNR. “Object number where this standard text will be saved (internal number can be checkedin SHXT table)

  
CALL FUNCTION 'CREATE_TEXT'
    
EXPORTING
      FID         
L_S_THEAD-TDID
      FLANGUAGE   
SY-LANGU
      FNAME       
L_F_TDNAME
      FOBJECT     
L_S_THEAD-TDOBJECT
      SAVE_DIRECT 
G_C_X
      FFORMAT     
'*'
    
TABLES
      FLINES      
P_G_T_LINES
    
EXCEPTIONS
      NO_INIT     
1
      NO_SAVE     
2
      
OTHERS      3.
  
IF SY-SUBRC <> 0.
    
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  
ENDIF.

No comments:

Post a Comment

/*Newer Post*/ Older Post Home