cancel
Showing results for 
Search instead for 
Did you mean: 

displlay value in script using perform-form .

Former Member
0 Kudos

hi

experts

i am new in script.

i am using function module read_text.

in my script there is 3 window and using this fm i want to put text in that script.

so i use form in se38 . my main problem is name1 = invoice no.

if invoice no change text is change .

how i use the variables in se38 and use in script?(main problem)

(V55ENAFT-vbeln = invoice no in script.)

CALL FUNCTION 'READ_TEXT'

EXPORTING

CLIENT = SY-MANDT

ID = 'NBOX'

LANGUAGE = 'E'

NAME = 'NAME1'

OBJECT = 'VBBK'

  • ARCHIVE_HANDLE = 0

  • LOCAL_CAT = ' '

  • IMPORTING

  • HEADER =

TABLES

LINES = tline2(vales of text)

  • EXCEPTIONS

  • OTHERS = 8

so i need to call 3 subroutines in 3 differnt window

thanks

ajay

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi ,

You can call subroutines created in programs in scripts as below:

in scripts you need to call subroutine as below:


perform get_text in program zprogram
using &V55ENAFT-vbeln&
changing &w_text&

in program:



form get_text tables i_tab structure itcsy o_tab strucutre itcsy.
read table i_tab with key name = 'V55ENAFT-vbeln'.

here you will have the value of the invoice in i_tab -value.

so get the text for the invoice and assign to o-tab


CALL FUNCTION 'READ_TEXT'
EXPORTING
CLIENT = SY-MANDT
ID = 'NBOX'
LANGUAGE = 'E'
NAME = V55ENAFT-vbeln
OBJECT = 'VBBK'
* ARCHIVE_HANDLE = 0
* LOCAL_CAT = ' '
* IMPORTING
* HEADER =
TABLES
LINES = w_text
* EXCEPTIONS

* OTHERS = 8

o_tab-name = 'w_text'.
value = w_text.

Regards,

Himanshu

Former Member
0 Kudos

HI

1 error in script while debuging 'PARAMETER USING IS INVALID'

&V55ENAFT-VBELN& HERE INVOIVE NO IS COMMING

BUT IN CHANGING NO TEXT.(NO VALUE)

CODE IN SE38.

form EXPORT tables i_tab structure itcsy o_tab STRUCTURE itcsy.

read table i_tab with key name = 'V55ENAFT-VBELN'.

DATA:W_TEXT LIKE TLINE OCCURS 0 WITH HEADER LINE.

DATA: VALUE TYPE C.

CALL FUNCTION 'READ_TEXT'

EXPORTING

  • CLIENT = SY-MANDT

ID = 'NBOX'

LANGUAGE = 'E'

NAME = 'V55ENAFT-VBELN'

OBJECT = 'VBBK'

  • ARCHIVE_HANDLE = 0

  • LOCAL_CAT = ' '

  • IMPORTING

  • HEADER =

TABLES

LINES = W_TEXT

o_tab-name = 'w_text'.

value = w_text.

IN SCRIPT

PERFORM export in program zexport using &v55enaft-vbeln&changing &text&

endperform.

<v1>no of boxes</> : &text&

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

Refer to the following link.

Thank You.

Regards,

Dhanalakshmi L

Former Member
0 Kudos

You need to follow Himanshu's example exactly. I think the PERFORM and USING commands go on separate lines.


/:  PERFORM export in program zexport 
/:  using &v55enaft-vbeln(K)&
/:  changing &text&
/:  endperform

I also added the "K" parameter to the variable. It will pass the document number without formatting. If you do no use it, the leading zeroes will be removed from the document number. The READ_TEXT function may not work.

When you read the variable in your ABAP program, you need to put the value somewhere.

read table i_tab with key name = 'V55ENAFT-VBELN'.
if sy-subrc = 0.
  lv_vbeln = i_tab-value.
endif.

You would use this variable in your READ_TEXT call.

Once you have the line of text, you need to put it back into the internal table so it can be read by the SAPscript layout set.

Former Member
0 Kudos

Instead of using Form routines in scripts you may use include texts



/:   INCLUDE &V55ENAFT-VBELN& OBJECT VBBK ID NBOX PARAGRAPH XX LANGUAGE E