SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

Возможно ли использовать Field-symbol в логике экрана?



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> ABAP
View previous topic :: View next topic  
Author Message
Максим
Специалист
Специалист



Joined: 27 Sep 2007
Posts: 61

PostPosted: Mon Mar 03, 2008 10:14 am    Post subject: Возможно ли использовать Field-symbol в логике экрана? Reply with quote

Доброе утро, такой вопрос:
Возможно ли передать параметры в модуль, наподобии USING в PERFORM?
Для примера, сейчас делаю так:

FIELD g_text1 MODULE modify_text1.
FIELD g_text2 MODULE modify_text2.
...
FIELD g_text7 MODULE modify_text7.
Модули modify_text1, ... modify_text7 очень похожи, кроме названия поля экрана.

Возможно ли сделать так?

FIELD g_text1 MODULE modify_text USING g_text1.
FIELD g_text7 MODULE modify_text USING g_text7.

или так

FIELD <fs_text> MODULE modify_text.
Back to top
View user's profile Send private message
John Doe
Модератор
Модератор


Age: 46
Joined: 05 Nov 2007
Posts: 725
Location: КраснАдар

PostPosted: Mon Mar 03, 2008 10:47 am    Post subject: Reply with quote

Нужно сделать так:
Code:
CHAIN.
  FIELD F1.
  FIELD F2.
   .....
   MODULE MODIFY_TEXT ON CHAIN-REQUEST.
ENDCHAIN.
Back to top
View user's profile Send private message Blog
Максим
Специалист
Специалист



Joined: 27 Sep 2007
Posts: 61

PostPosted: Mon Mar 03, 2008 11:33 am    Post subject: Reply with quote

спасибо, буду пробовать.
Back to top
View user's profile Send private message
Максим
Специалист
Специалист



Joined: 27 Sep 2007
Posts: 61

PostPosted: Mon Mar 03, 2008 1:18 pm    Post subject: Reply with quote

John Doe wrote:
Нужно сделать так:
Code:
CHAIN.
  FIELD F1.
  FIELD F2.
   .....
   MODULE MODIFY_TEXT ON CHAIN-REQUEST.
ENDCHAIN.


Как в модуле MODIFY_TEXT узнать имя поля (f1, f2 или f7), для которого он вызван?
Back to top
View user's profile Send private message
John Doe
Модератор
Модератор


Age: 46
Joined: 05 Nov 2007
Posts: 725
Location: КраснАдар

PostPosted: Mon Mar 03, 2008 2:53 pm    Post subject: Reply with quote

Code:
MODULE MODIFY_TEXT  INPUT.
  FIELD-SYMBOLS: <FIELD>.
  LOOP AT SCREEN.
    IF SCREEN-NAME CP '*FIELD*'.
      ASSIGN (SCREEN-NAME) TO <FIELD>.
      WRITE <FIELD>.
    ENDIF.
  ENDLOOP.
ENDMODULE.                 " MODIFY_TEXT INPUT
Back to top
View user's profile Send private message Blog
vga
Мастер
Мастер


Age: 180
Joined: 04 Oct 2007
Posts: 1218
Location: Санкт-Петербург

PostPosted: Mon Mar 03, 2008 6:07 pm    Post subject: Reply with quote

Или еще так:

Code:
MODULE MODIFY_TEXT INPUT.

  DATA: field(30).
  FIELD-SYMBOLS: <fs>.
  GET CURSOR FIELD field.
  ASSIGN (field) TO <fs>.

ENDMODULE.    " MODIFY_TEXT INPUT
Back to top
View user's profile Send private message Blog Visit poster's website
John Doe
Модератор
Модератор


Age: 46
Joined: 05 Nov 2007
Posts: 725
Location: КраснАдар

PostPosted: Mon Mar 03, 2008 9:38 pm    Post subject: Reply with quote

vga wrote:
Или еще так:

Code:
MODULE MODIFY_TEXT INPUT.

  DATA: field(30).
  FIELD-SYMBOLS: <fs>.
  GET CURSOR FIELD field.
  ASSIGN (field) TO <fs>.

ENDMODULE.    " MODIFY_TEXT INPUT

Ну это только для последнего ввода актуально Smile
Back to top
View user's profile Send private message Blog
vga
Мастер
Мастер


Age: 180
Joined: 04 Oct 2007
Posts: 1218
Location: Санкт-Петербург

PostPosted: Mon Mar 03, 2008 9:50 pm    Post subject: Reply with quote

John Doe wrote:
Ну это только для последнего ввода актуально Smile


Так может это и надо Very Happy
Back to top
View user's profile Send private message Blog Visit poster's website
Максим
Специалист
Специалист



Joined: 27 Sep 2007
Posts: 61

PostPosted: Tue Mar 04, 2008 10:56 am    Post subject: Reply with quote

Спасибо, воспользовался вашими советами, сделал так.

Code:
DATA: g_text1(10),
      g_text2(10),
      g_text3(10),
      g_text4(10),
      g_text5(10),
      g_text6(10),
      g_text7(10).

*&---------------------------------------------------------------------*
*&      Module  MODIFY_TEXT  INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
module MODIFY_TEXT input.
  DATA: field(30).
  FIELD-SYMBOLS: <fs>.
  GET CURSOR FIELD field.
  ASSIGN (field) TO <fs>.

* проверка введенного значения
*......
*
  CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
             EXPORTING
                  input  = <fs>
             IMPORTING
                  output = <fs>.
endmodule.                 " MODIFY_TEXT  INPUT

PROCESS AFTER INPUT.
MODULE USER_COMMAND_0100.

CHAIN.
  FIELD g_text1.
  FIELD g_text2.
  FIELD g_text3.
  FIELD g_text4.
  FIELD g_text5.
  FIELD g_text6.
  FIELD g_text7.
  MODULE MODIFY_TEXT ON CHAIN-REQUEST.
ENDCHAIN.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> ABAP All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG.
SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG.
Every effort is made to ensure content integrity. Use information on this site at your own risk.