Text handling in InputScripts

Texts are normally displayed and edited in a special “text control” in the SAP transactions. Here you can look over lengthy texts and change them easily if need be. In some cases, the  “SapScript Editor” is used instead. 
G
uiXT offers several possibilities to support text editing. In particular, when you simplify transactions, you can also integrate text handling. Here we present the technique to make use of GuiXT text handling.
 

1. Insert a text proposal: To facilitate text entry, you offer one or several pushbuttons to insert standard text proposals that the user can change afterwards. In your proposal you can use text variables that are replaced by actual field values from the transaction. It is also possible to select the text proposal dependant on certain data in the transaction (e.g. priority).

Sap Guixt texts1 Text handling in InputScripts 

GuiXT Script SAPLCOIH.ED3000.txt:
if X[LTEXT]
  Pushbutton (7,84) “Text proposal” process=”textproposal.txt”
endif 
Sap Guixt texts2 Text handling in InputScripts

InputScript textproposal.txt:
Screen saplcoih.3000

Set V[Prio] “&F[Priority]“
if V[Prio=1]
  CopyText fromTemplate=”iw31text_prio1.txt” toText=”iw31″ 
else
  CopyText fromTemplate=”iw31text.txt” toText=”iw31″ 
endif
CopyText fromText=”iw31″ toScreen=”X[LTEXT]“ 
Enter

Text proposal Priority 1 1  iw31text_prio1.txt:
Maintenance for Eqipment &F[Equipment]

V e r y   u r g e n t

Reason:

 

2. Text editing in single screen transactions: As an example we add to transaction MM02 (Change material) a pushbutton that invokes direct editing of the material text. The example is shown to demonstrate the technique; in every day applications additional data will most likely be maintained on this screen as well.

Sap Guixt texts3 Text handling in InputScripts

Sap Guixt texts4 Text handling in InputScripts

GuiXT Script SAPLMGMM.ED0060.txt:
if Q[Transaction=MM02]
  Offset (6,0)
  if V[MM02_DisplayTextbox=X]
    Box (0,0) (17,82) 
    InputField (1,1) “Material &V[MM02_Material]” (2,1) Size=40 name=”MM02_Materialtext”
   
TextBox (3,1) (15,80) name=”MM02_text”

    Pushbutton (16,2)  “@2L@Save”           process=”MM02_UpdateText.txt”
    Pushbutton (16,20) “@42@Refresh text”   process=”MM02_ReadText.txt”
    Pushbutton (1,78)  “@02@”               process=”MM02_CloseText.txt”

  else
    Pushbutton (1,0) “Change material name and description” process=”MM02_ReadText.txt” size=2
  endif
endif

InputScript MM02_UpdateText.txt:
  Set F[Material] “&V[MM02_Material]“
  Enter

Screen SAPLMGMM.0070
  set cell[Table,0,1] “X”
  Enter 

Screen SAPLMGMM.4004
  Enter “=PB26″ 

Screen SAPLMGMM.4300
  Set F[MAKT-MAKTX] “&V[MM02_Materialtext]“
 
CopyText toScreen=”X[LONGTEXT_GRUNDD]” fromText=”MM02_text”
  Enter “/11″

InputScript MM02_ReadText.txt:
Set V[MM02_Material] “&F[Material]“

Screen SAPLMGMM.0070
  set cell[Table,0,1] “X”
  Enter 

Screen SAPLMGMM.4004
  Enter “=PB26″ 

Screen SAPLMGMM.4300
  Set V[MM02_Materialtext] “&F[MAKT-MAKTX]“
 
CopyText fromScreen=”X[LONGTEXT_GRUNDD]” toText=”MM02_text”

  Set V[MM02_DisplayTextbox] “X” 
  Enter “/NMM02″

InputScript MM02_CloseText.txt:
Set V[MM02_DisplayTextbox] “N”
Enter “/NMM02″

 

 

Text handling in InputScripts