cancel
Showing results for 
Search instead for 
Did you mean: 

Smartform

Former Member
0 Kudos

Hi all,

I want to use

PERFORM READ_TEXT using 'Z014' 'E' H_OBJ1 'VBBP'. in the 'Programming Lines' of a smartform.

where should i use the FORM ENDFORM so that i can get the T_TLINE data , after my subroutine is executed??

my FORM statement is like

FORM READ_TEXT using p_id like

p_lan like

p_name like

p_obj like

CALL FUNTION 'READ_TEXT'

Exporting

client = sy-mandt

id = p_id

lan = p_lan

name = p_name

object = p_obj

TABLES

LINES = T_TLINE

ENDFORM.

How & where to declare the table T_TLINE table ???plz give me the correct idea so that i can reward points.

Regards

smita

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

T_TLINE shud be decalred with in the program lines

data: T_TLINE type table of .....(structure refferd by FM)

U can write the logic of Perform and Form routine with in the same pRogarm lines node.

PERFORM READ_TEXT using 'Z014' 'E' H_OBJ1 'VBBP' tables T_TLINE .

FORM READ_TEXT using p_id like table t_line like ......(ref structure)

p_lan like

p_name like

p_obj like

CALL FUNTION 'READ_TEXT'

Exporting

client = sy-mandt

id = p_id

lan = p_lan

name = p_name

object = p_obj

TABLES

LINES = T_TLINE

ENDFORM.

Revert back if any issues,

Regards,

Naveen

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

You can write ur Form routine under the tab 'Form Routines' in Global definitions. Please declare T_TLINE also in the Form Routines.

When you are writing the code lines use T_TLINE in the input and output parameters also.

Regards,

KK

Former Member
0 Kudos

hi

good

go through this code and use the READ_TEXT fm accordingly.

SELECT-OPTIONS: S_MATNR FOR PBIM-MATNR,

S_WERKS FOR PBIM-WERKS.

DATA: BEGIN OF HTEXT.

INCLUDE STRUCTURE THEAD.

DATA: END OF HTEXT.

DATA: BEGIN OF LTEXT OCCURS 50.

INCLUDE STRUCTURE TLINE.

DATA: END OF LTEXT.

DATA: BEGIN OF DTEXT OCCURS 50.

DATA: MATNR LIKE PBIM-MATNR.

INCLUDE STRUCTURE TLINE.

DATA: END OF DTEXT.

DATA: TNAME LIKE THEAD-TDNAME.

SELECT * FROM PBIM WHERE WERKS IN S_WERKS.

MOVE PBIM-BDZEI TO TNAME.

CALL FUNCTION 'READ_TEXT'

EXPORTING

  • CLIENT = SY-MANDT

ID = 'PB'

LANGUAGE = 'E'

NAME = TNAME

OBJECT = 'PBPT'

  • ARCHIVE_HANDLE = 0

IMPORTING

HEADER = HTEXT

TABLES

LINES = LTEXT

EXCEPTIONS

ID = 1

LANGUAGE = 2

NAME = 3

NOT_FOUND = 4

OBJECT = 5

REFERENCE_CHECK = 6

WRONG_ACCESS_TO_ARCHIVE = 7

OTHERS = 8.

LOOP AT LTEXT.

IF LTEXT-TDLINE NE ''.

MOVE LTEXT-TDLINE TO DTEXT-TDLINE.

MOVE PBIM-MATNR TO DTEXT-MATNR.

APPEND DTEXT.

ENDIF.

ENDLOOP.

ENDSELECT.

LOOP AT DTEXT.

WRITE:/ DTEXT-MATNR, DTEXT-TDLINE.

ENDLOOP.

reward point if helpful.

thanks

mrutyun^