Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 10116

Re: Long text indicator against Notification task & SubOrder creation

$
0
0

I know I am posting answer to very old thread as did not find any answer so far, so giving clue. See if new solution seekers this helps you now…

Cause:

As the create_text or save_text  does creation of text at data base level and does not pass through all the screens of the particular transaction, so the text editor icon is not enabled  [like in tcode IW23 (IW33) Notification display text editor, tables holding damage text and cause text indicator qmfe-indtx & qmur-indtx I ]

Solution:

  1. Read existing text using FM READ_TEXT i.e. retain existing text in internal table, say IT_READ
  2. Delete existing text using FM 'DELETE_TEXT'. Remember to set save_direct = x
  3. Perform BDC to add dummy text doing call transaction. This will set text indicator to ‘X’.
  4. Append your new ext to IT_READ.
  5. Now create text again using FM 'CREATE_TEXT'. Remember to set save_direct = x
  6. If you have requirement that created text should not be editable then you need to change format of IT_READ.

Like IT_READ-tdformat = ‘>X’ & IT_READ-tdline = ‘*<one space><your text>’ [may use CONCATENATE '*' IT_READ-tdline INTO IT_READ-tdline SEPARATED BY space.].

Below are above steps code snap shots.

Bdc part for IW22

……….
PERFORM bdc_dynpro USING 'X' 'SAPLIQS0' '7200'.
PERFORM bdc_field USING 'BDC_OKCODE' '=TXPS'. "DAMAGE_TXT icon
or  
PERFORM bdc_field USING 'BDC_OKCODE' '=TXUR'. "CAUSE_TXT icon

Based on your text editor configured to keep track of timestamp log, use one of the option. My case first two lines of text editor shown timestamp log lines and they are non editable.
*  PERFORM bdc_dynpro USING 'X'  'SAPLSTXX' '1100'.
*  PERFORM bdc_field USING 'BDC_CURSOR'  'RSTXT-TXLINE(02)'.
*  PERFORM bdc_field USING 'BDC_OKCODE'  '=POSF'.
*  PERFORM bdc_field USING 'RSTXT-TXPARGRAPH(02)' '*'.
*  PERFORM bdc_field USING 'RSTXT-TXLINE(02)' 'Dummy text for indicator line 2'.

*  PERFORM bdc_dynpro USING 'X'  'SAPLSTXX' '1100'.
*  PERFORM bdc_field USING 'BDC_CURSOR'  'RSTXT-TXLINE(03)'.
*  PERFORM bdc_field USING 'BDC_OKCODE'  '=POSF'.
*  PERFORM bdc_field USING 'RSTXT-TXPARGRAPH(03)' '*'.
*  PERFORM bdc_field USING 'RSTXT-TXLINE(03)' 'Dummy text for indicator line 3'.

PERFORM bdc_dynpro USING 'X'  'SAPLSTXX' '1100'.
PERFORM bdc_field USING 'BDC_CURSOR'  'RSTXT-TXLINE(04)'.
PERFORM bdc_field USING 'BDC_OKCODE'  '=POSF'.
PERFORM bdc_field USING 'RSTXT-TXPARGRAPH(04)' '*'.
PERFORM bdc_field USING 'RSTXT-TXLINE(04)' 'Dummy text for indicator line 4'.

PERFORM bdc_field       USING 'BDC_OKCODE'  '=TXBA'.

…………….

FORM bdc_dynpro USING    value1
value2
value3
.
CLEAR bdcdata.
bdcdata
-dynbegin = value1.
bdcdata
-program = value2.
bdcdata
-dynpro = value3.
APPEND bdcdata.

ENDFORM.                               " BDC_DYNPRO

 

form DELETE_EXISTINGTEXT.
CALL FUNCTION 'DELETE_TEXT'
EXPORTING
CLIENT          = sy-mandt
ID              =   LTXT
LANGUAGE        =   E
name           
=   <notification number + suffix>

–  determine from text editor header damage text need suffixed 0001 , cause text need suffixed 00010001
object         
=   QMFE = damage or QMUR = CAUSE
savemode_direct
= 'X'
*     TEXTMEMORY_ONLY = ' '
*     LOCAL_CAT       = ' '
EXCEPTIONS
not_found      
= 1
OTHERS          = 2.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT          = gc_x
.

endform.                    " DELETE_EXISTINGTEXT

    CALL FUNCTION 'CREATE_TEXT'
EXPORTING
fid        
= LTXT
flanguage  
= E
fname      
= <notification number + suffix>

–  determine from text editor header damage text need suffixed 0001 , cause text need suffixed 00010001
object         
=   QMFE = damage or QMUR = CAUSE

        fobject     = QMFE = damage or QMUR = CAUSE
save_direct
= x
fformat    
= ‘>X’
TABLES
flines     
= t_editor_text
EXCEPTIONS
no_init    
= 1
no_save    
= 2
OTHERS      = 3.

    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = gc_x.
.


Viewing all articles
Browse latest Browse all 10116

Trending Articles