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

Internal Tables

Former Member
0 Likes
972

Hello:

I must say that I did try to solve it, but I lack the correct focus for this. I have this code but I can't get the commented part to work:


FUNCTION Z_SAP_GET_CREDIT.
*"----------------------------------------------------------------------
*"*"Interfase local
*"  IMPORTING
*"     VALUE(CLIENT_ID) TYPE  Z_CLIENT_ID OPTIONAL
*"  EXPORTING
*"     VALUE(CREDIT_LIMIT) TYPE  KNB1-WEBTR
*"     VALUE(CONDITIONS) TYPE  KNB1-ZTERM
*"  EXCEPTIONS
*"      USER_DOES_NOT_EXIST
*"----------------------------------------------------------------------

TYPES: BEGIN OF credit_eq_type,
         WEBTR  LIKE KNB1-WEBTR,
         ZTERM  LIKE KNB1-ZTERM,
       END OF credit_eq_type.

DATA: credit_eq TYPE  credit_eq_type.


CONSTANTS BU LIKE KNB1-BUKRS value 'FSMX'.
CONSTANTS LANGUAGE LIKE T005T-SPRAS value 'S'.

call function 'CONVERSION_EXIT_ALPHA_INPUT'
     EXPORTING
      INPUT = CLIENT_ID
     IMPORTING
      OUTPUT = CLIENT_ID.

SELECT SINGLE WEBTR ZTERM
FROM KNB1
INTO credit_eq
WHERE KUNNR = CLIENT_ID.

CREDIT_LIMIT = credit_eq-WEBTR.
CONDITIONS = credit_eq-ZTERM.

*CALL FUNCTION 'FI_PRINT_ZTERM'
*EXPORTING
*I_ZTERM = credit_eq-ZTERM
*I_LANGU = LANGUAGE
*I_XT052U = 'X'
*TABLES
*T_ZTEXT = MY_TEXT.

ENDFUNCTION.

How should I define the MY_TEXT table for me to be able to retrieve the results of the 'FI_PRINT_ZTERM' function?

Thanks

Alejandro

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
935

Define MY_TEXT like this:

data: MY_TEXT type table of TTEXT.

7 REPLIES 7
Read only

Former Member
0 Likes
935

Hi,

declare like this,

DATA: BEGIN OF MY_TEXT OCCURS 5,

LINE(50),

END OF MY_TEXT.

Regards,

GSR.

Read only

Former Member
0 Likes
936

Define MY_TEXT like this:

data: MY_TEXT type table of TTEXT.

Read only

Former Member
0 Likes
935

data :MY_TEXT type TTEXT .

Read only

Former Member
0 Likes
935

data: my_text type table of ttext.

Read only

alejandro_lpez
Contributor
0 Likes
935

Hi Alejandro,

Define table like this:

data: T_ZTEXT TYPE STANDARD TABLE OF TTEXT,

and if you need, create a work area to proccess data:

data: WA_ZTEXT LIKE LINE OF T_ZTEXT.

regards

Read only

0 Likes
935


report zrich_0003.

<b>
data: itext type table of ttext.
data: xtext type ttext.</b>
call function 'FI_PRINT_ZTERM'
* EXPORTING
*   I_ZTERM               =
*   I_LANGU               = SY-LANGU
*   I_XT052U              = ' '
*   I_T052                =
  tables
    t_ztext               = itext
 exceptions
   zterm_not_found       = 1
   others                = 2.


<b>loop at itext into xtext.

  write:/ xtext.
endloop.</b>

Regards,

Rich Heilman

Read only

0 Likes
935

Thanks guys. Exactly what I wanted....

Kind Regards

Alejandro