Application Development and Automation 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: 
Read only

Function code for text field

Former Member
0 Likes
1,559

Hi,

Can u anybody tell hoe to give function code for a text box in selection screen.?

Eg. when the user give the emp id his/her corresponding available telephone numbers should be displayed in Telephone Number field as F4 help....

Thanks in advance.

6 REPLIES 6
Read only

Former Member
0 Likes
894

Hi Tharani,

Try this.

SELECTION-SCREEN BEGIN OF BLOCK b_0 WITH FRAME TITLE text-000.

PARAMETERS: s_text TYPE char450.

SELECTION-SCREEN END OF BLOCK b_0.

Also, pls chk this code.

Look at class cl_gui_textedit

(1) Screen

In dynpro create a custom container, call it 'INPUTBOX' or so

(2) In program top, declare

codeDATA: container TYPE REF TO cl_gui_custom_container,

editor TYPE REF TO cl_gui_textedit.[/code]

(3) in PBO

if editor is initial.

CREATE OBJECT: container EXPORTING container_name = 'TEXTBOX',

editor EXPORTING parent = container

wordwrap_mode = 2

wordwrap_position = 80

wordwrap_to_linebreak_mode = 1.

CALL METHOD editor->set_text_as_r3table

EXPORTING table = texttab.

ENDIF.

(4) in PAI

read the text

codeIF NOT init IS INITIAL.

CALL METHOD editor->get_text_as_r3table

IMPORTING table = texttab.[/code]

exit and release

code CALL METHOD editor->free.

CALL METHOD container->free.

CLEAR: editor, container.

ENDIF.[/code]

Look at SAP Textedit.

kindly reward if found helpful.

cheers,

Hema.

Read only

0 Likes
894

we are fresher so plz tell alternative to solve it without using class. and we are doing report program not module pool.

Read only

0 Likes
894

YAAR DONT HAVE TO TAKE DAT MUCH PAIN TRY PARAMETERS AND U WILL GET A TEXT BOX IN WHICH U CAN ENTER VALUES.

YOU CAN ALSO TRY SELECT OPTIONS LIKE:

SELECT-OPTIONS : s_ebeln FOR ekko-ebeln .

PLZ REWARD IF USEFUL

REGARDS

VIVEK

Read only

0 Likes
894

hi..

as per above example the f4 help should not get all the telephone numbers available in database. the f4 should have the corresponding phone numbers of a emp typed in the previous textbox.

Read only

Former Member
0 Likes
894

Hi,

Write the code as below in your report.

at selection-screen on field text_field.

if sy-subrc = 0.

endif.

Keep a break point on IF SY-SUBRC = 0 and execute the program.

When the program goes into debug mode, Check value of SY-UCOMM, this is the function code.

Regards,

Satish

Read only

Former Member
0 Likes
894

Tharani,

We can get the F4 help if we use search helps.

Can you please be clear about your requirement.

Thanks,

Madhan.