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: 

Re:Urgent plz help me

Former Member
0 Kudos

Hi,

if i click on my screen field search help the S010 screen should open for typing email ids in and store as textid id in database, but the i need to change selection screen fields of so10 ,coz users dont have access to so10 so we need to bluff them as if it is different screen , can any one help me in coding

5 REPLIES 5

former_member194669
Active Contributor
0 Kudos

Hi,

After looking lot of your previous threads related to S010. my suggestion will be go for custom module pool (dialog programming) create a custom screen with SO10 fields. and update the values in textid's or update your custom tables?

My suggestion is to not clone SO10.

aRs

0 Kudos

Hi,

what you said is correct but iam new to programming , how should i attach that change editor code to my customised coding, if i see s010 sap prg iam not understanding the flow

0 Kudos

Hi

first design a small screen using module pool programming

and then use the function modules CREATE_TEXT and SAVE_TEXT

to create the Long text like SO10 screen and to save that long text.

see the sample module pool program and design it

Go to se38 and give demodynpro and press F4.

YOu will get a list of demo module pool programs.

One more T-Code is ABAPDOCU.

YOu can find more examples there.

See the prgrams:

DEMO_DYNPRO_TABLE_CONTROL_1 Table Control with LOOP Statement

DEMO_DYNPRO_TABLE_CONTROL_2 Table Control with LOOP AT ITAB

http://www.geocities.com/ZSAPcHAT

http://www.allsaplinks.com/files/using_table_in_screen.pdf

<b>Reward points for useful Answers</b>

Regards

Anji

former_member194669
Active Contributor
0 Kudos

Hi,

Your issue is only change editor for long text., then check this code

write this under your user_command PAI module


  clear i_header.
  i_header-tdobject = c_text.
  i_header-tdid     = c_st.
  i_header-tdspras  = sy-langu.
  w_id              = c_st.
  w_object          = c_text.

  if v_txtid is initial.
    if not v_docno is initial.
      concatenate 'ycc' sy-mandt '_' v_docno into i_header-tdname.
      v_txtid = i_header-tdname.
      w_title       = text-023.
      v_hsave       = c_x.
  endif,
  append i_header.

* Read text
  call function 'read_text'
    exporting
      id                      = w_id
      language                = sy-langu
      name                    = i_header-tdname
      object                  = w_object
    importing
      header                  = i_header
    tables
      lines                   = i_lines
    exceptions
      id                      = 1
      language                = 2
      name                    = 3
      not_found               = 4
      object                  = 5
      reference_check         = 6
      wrong_access_to_archive = 7
      others                  = 8.

  if sy-subrc = '4'.
    i_lines1[] = i_lines[].
    call function 'init_text'
      exporting
        id       = w_id
        language = sy-langu
        name     = i_header-tdname
        object   = w_object
      importing
        header   = i_header
      tables
        lines    = i_lines
      exceptions
        id       = 1
        language = 2
        name     = 3
        object   = 4
        others   = 5.
    i_lines[] = i_lines1[].
  endif.

  call function 'edit_text'
    exporting
      display       = f_display
      editor_title  = w_title
      header        = i_header
      save          = p_save
    importing
      function      = w_function
      newheader     = i_newheader
      result        = i_result
    tables
      lines         = i_lines
    exceptions
      id            = 1
      language      = 2
      linesize      = 3
      name          = 4
      object        = 5
      textformat    = 6
      communication = 7
      others        = 8.

aRs

If found useful please assign points

Message was edited by:

Former Member
0 Kudos

REPORT ZTANVI .

TYPE-POOLS VRM.

TABLES: ZSCREEN,stxh.

DATA:IVRM TYPE VRM_VALUES,

NAME TYPE VRM_ID,

IVRM_DATA LIKE LINE OF IVRM.

DATA : LANGUAGE like T002-SPRAS value 'E',

ACTION like ttxct-function,

TEXTTITLE like ttxit-tdtext.

data: GROUPNAME TYPE VRM_ID.

data:OKCODE TYPE SY-UCOMM.

data: begin of wa_groupname.

include structure zscreen.

data end of wa_groupname .

data: save_ok like OKCODE.

DATA BEGIN OF TEXTHEADER.

include structure thead.

data end of textheader.

data begin of textlines occurs 0.

include structure tline.

data end of textlines.

call screen 100.

&----


*& Module STATUS_0100 OUTPUT

&----


  • text

----


module STATUS_0100 output.

  • SET PF-STATUS 'xxxxxxxx'.

  • SET TITLEBAR 'xxx'.

loop at screen.

wa_groupname-zcustcode = 'BC1' .

if screen-name = wa_groupname-zcustcode .

screen-input = 0.

modify screen.

endif.

endloop.

CLEAR:IVRM, IVRM[].

select ZCUSTCODE ZSO ZSOCC ZSH ZSHCC from zscreen into corresponding

fields of

wa_groupname

where zcustcode = 'BC1'.

IVRM_DATA-KEY = wa_groupname-ZSO.

IVRM_DATA-TEXT = wa_groupname-ZSO.

append ivrm_data to ivrm.

IVRM_DATA-KEY = wa_groupname-ZSOCC.

IVRM_DATA-TEXT = wa_groupname-ZSOCC.

append ivrm_data to ivrm.

IVRM_DATA-KEY = wa_groupname-ZSH.

IVRM_DATA-TEXT = wa_groupname-ZSH.

append ivrm_data to ivrm.

IVRM_DATA-KEY = wa_groupname-ZSHCC.

IVRM_DATA-TEXT = wa_groupname-ZSHCC.

append ivrm_data to ivrm.

endselect.

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

id = 'wa_groupname-zsocc'

values = IVRM

  • EXCEPTIONS

  • ID_ILLEGAL_NAME = 1

  • OTHERS = 2

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

endmodule. " STATUS_0100 OUTPUT

&----


*& Module USER_COMMAND_0100 INPUT

&----


  • text

----


module USER_COMMAND_0100 input.

save_ok = OKCODE.

case save_ok.

when 'DISPLAY'.

*message e000(zmsg) with wa_groupname-ZSOCC.

perform display_editor using wa_groupname-ZSOCC.

WHEN 'EDIT'.

perform edit_editor using wa_groupname-ZSOCC.

when 'CREATE'.

select single * from stxh where tdname = wa_groupname-ZSOCC.

if sy-subrc eq 0.

message s000(zmsg) with 'Groupname already created'.

else.

perform create_editor using wa_groupname-ZSOCC.

endif.

when others.

leave program.

endcase.

endmodule. " USER_COMMAND_0100 INPUT

&----


*& Form display_editor

&----


  • text

----


  • -->P_WA_GROUPNAME_ZSOCC text

----


form display_editor using p_wa_groupname_zsocc.

TEXTHEADER-TDOBJECT = 'TEXT'.

TEXTHEADER-TDNAME = p_wa_groupname_zsocc.

TEXTHEADER-TDID = 'ST'.

TEXTHEADER-TDSPRAS = 'E'.

TEXTHEADER-TDLINESIZE = 100.

CALL FUNCTION 'READ_TEXT'

EXPORTING

  • CLIENT = SY-MANDT

id = 'ST'

language = 'E'

name = p_wa_groupname_zsocc

object = 'TEXT'

  • ARCHIVE_HANDLE = 0

  • LOCAL_CAT = ' '

  • IMPORTING

HEADER = textheader

tables

lines = textlines

  • EXCEPTIONS

  • ID = 1

  • LANGUAGE = 2

  • NAME = 3

  • NOT_FOUND = 4

  • OBJECT = 5

  • REFERENCE_CHECK = 6

  • WRONG_ACCESS_TO_ARCHIVE = 7

  • OTHERS = 1

.

CALL FUNCTION 'EDIT_TEXT'

EXPORTING

DISPLAY = 'X'

  • EDITOR_TITLE = p_wa_groupname_zsocc

header = TEXTHEADER

  • PAGE = ' '

  • WINDOW = ' '

SAVE = SPACE

  • LINE_EDITOR = ' '

  • CONTROL = ' '

  • PROGRAM = ' '

  • LOCAL_CAT = ' '

IMPORTING

FUNCTION = ACTION

NEWHEADER = TEXTHEADER

  • RESULT =

tables

lines = TEXTLINES.

*

*message e000(zmsg) with p_wa_groupname_zsocc.

endform. " display_editor

&----


*& Form edit_editor

&----


  • text

----


  • -->P_WA_GROUPNAME_ZSOCC text

----


form edit_editor using p_wa_groupname_zsocc.

TEXTHEADER-TDOBJECT = 'TEXT'.

TEXTHEADER-TDNAME = p_wa_groupname_zsocc.

TEXTHEADER-TDID = 'ST'.

TEXTHEADER-TDSPRAS = 'E'.

TEXTHEADER-TDLINESIZE = 100.

CALL FUNCTION 'READ_TEXT'

EXPORTING

  • CLIENT = SY-MANDT

id = 'ST'

language = 'E'

name = p_wa_groupname_zsocc

object = 'TEXT'

  • ARCHIVE_HANDLE = 0

  • LOCAL_CAT = ' '

  • IMPORTING

HEADER = textheader

tables

lines = textlines

  • EXCEPTIONS

  • ID = 1

  • LANGUAGE = 2

  • NAME = 3

  • NOT_FOUND = 4

  • OBJECT = 5

  • REFERENCE_CHECK = 6

  • WRONG_ACCESS_TO_ARCHIVE = 7

  • OTHERS = 1

.

CALL FUNCTION 'EDIT_TEXT'

EXPORTING

DISPLAY = ' '

  • EDITOR_TITLE = p_wa_groupname_zsocc

header = TEXTHEADER

  • PAGE = ' '

  • WINDOW = ' '

SAVE = SPACE

  • LINE_EDITOR = ' '

  • CONTROL = ' '

  • PROGRAM = ' '

  • LOCAL_CAT = ' '

IMPORTING

FUNCTION = ACTION

NEWHEADER = TEXTHEADER

  • RESULT =

tables

lines = TEXTLINES.

CALL FUNCTION 'SAVE_TEXT'

EXPORTING

  • CLIENT = SY-MANDT

header = TEXTHEADER

  • INSERT = ' '

  • SAVEMODE_DIRECT = ' '

  • OWNER_SPECIFIED = ' '

  • LOCAL_CAT = ' '

IMPORTING

  • FUNCTION =

NEWHEADER = TEXTHEADER

tables

lines = TEXTLINES

  • EXCEPTIONS

  • ID = 1

  • LANGUAGE = 2

  • NAME = 3

  • OBJECT = 4

  • OTHERS = 5

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

CALL FUNCTION 'COMMIT_TEXT'

EXPORTING

OBJECT = 'TEXT'

NAME = p_wa_groupname_zsocc

ID = 'ST'

LANGUAGE = 'E'

  • SAVEMODE_DIRECT = ' '

  • KEEP = ' '

  • LOCAL_CAT = ' '

  • IMPORTING

  • COMMIT_COUNT =

  • TABLES

  • T_OBJECT =

  • T_NAME =

  • T_ID =

  • T_LANGUAGE =

.

endform. " edit_editor

&----


*& Form create_editor

&----


  • text

----


  • -->P_WA_GROUPNAME_ZSOCC text

----


form create_editor using p_wa_groupname_zsocc.

TEXTHEADER-TDOBJECT = 'TEXT'.

TEXTHEADER-TDNAME = p_wa_groupname_zsocc.

TEXTHEADER-TDID = 'ST'.

TEXTHEADER-TDSPRAS = 'E'.

TEXTHEADER-TDLINESIZE = 100.

CALL FUNCTION 'EDIT_TEXT'

EXPORTING

DISPLAY = ' '

  • EDITOR_TITLE = p_wa_groupname_zsocc

header = TEXTHEADER

  • PAGE = ' '

  • WINDOW = ' '

SAVE = SPACE

  • LINE_EDITOR = ' '

  • CONTROL = ' '

  • PROGRAM = ' '

  • LOCAL_CAT = ' '

IMPORTING

FUNCTION = ACTION

NEWHEADER = TEXTHEADER

  • RESULT =

tables

lines = TEXTLINES.

CALL FUNCTION 'CREATE_TEXT'

EXPORTING

fid = 'ST'

flanguage = 'E'

fname = p_wa_groupname_zsocc

fobject = 'TEXT'

  • SAVE_DIRECT = 'X'

  • FFORMAT = '*'

tables

flines = TEXTLINES

  • 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.

CALL FUNCTION 'SAVE_TEXT'

EXPORTING

  • CLIENT = SY-MANDT

header = TEXTHEADER

  • INSERT = ' '

  • SAVEMODE_DIRECT = ' '

  • OWNER_SPECIFIED = ' '

  • LOCAL_CAT = ' '

IMPORTING

  • FUNCTION =

NEWHEADER = TEXTHEADER

tables

lines = TEXTLINES

  • EXCEPTIONS

  • ID = 1

  • LANGUAGE = 2

  • NAME = 3

  • OBJECT = 4

  • OTHERS = 5

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

CALL FUNCTION 'COMMIT_TEXT'

EXPORTING

OBJECT = 'TEXT'

NAME = p_wa_groupname_zsocc

ID = 'ST'

LANGUAGE = 'E'

  • SAVEMODE_DIRECT = ' '

  • KEEP = ' '

  • LOCAL_CAT = ' '

  • IMPORTING

  • COMMIT_COUNT =

  • TABLES

  • T_OBJECT =

  • T_NAME =

  • T_ID =

  • T_LANGUAGE =

.

endform. " create_editor