cancel
Showing results for 
Search instead for 
Did you mean: 

smartform. to print the item text of a PO (ME21N)

Former Member
0 Kudos

Hi,

I am just a beginner in smartform. I want to have the item text of a PO (ME21N) to be printed in the form. What I did, is I created a cell of a table, the cell contains a text and I used these parameters for the text:

Type: Include Text

Start: new Line

Text name : I keyed a name

Text Object: EKPO

Text ID: F01

No error if no text exists: ticked

But the text is not printed. Please enlighten me?

Thanks

Accepted Solutions (0)

Answers (10)

Answers (10)

Former Member
0 Kudos

thanks for your help . I greatly aprreciate it.

I am reading some document about smart form.

Former Member
0 Kudos

Hi,

Try this.

Declare in our global definitions as

ID type THEAD-TDID value 'BEST'

OBJ TYPE THEAD-TDOBJECT value 'MATERIAL'

LANG type THEAD-TDSPRAS value 'EN'

V_SPEC TYPE STANDARD TABLE OF TLINE

V_TDNAME will be your line item material Number.

 
CALL FUNCTION 'READ_TEXT'
EXPORTING
CLIENT   = SY-MANDT
ID       = id
LANGUAGE = lang
NAME     = V_TDNAME
OBJECT   = obj
TABLES
    LINES = V_SPEC
EXCEPTIONS
  ID                      = 1
  LANGUAGE                = 2
  NAME                    = 3
  NOT_FOUND               = 4
  OBJECT                  = 5
  REFERENCE_CHECK         = 6
  WRONG_ACCESS_TO_ARCHIVE = 7
  OTHERS                  = 8.

Former Member
0 Kudos

Hi HTO,

Just take it with ease.. Not to worry.. Hope you have taken inputs from Clemens Reply.

I hope you are using Table ( Header, Main Area, Footer ) to print data for your smartform.

Going ahead.. In my sample code

wa_itpotab is the work area which I am using in LOOP loop of table under Data section.

where you have this option:

Internal table <your internal table name> I INTO < work area concenrned to internal table >.

I had given like:

Internal table it_potab I INTO wa_itpotab.

So use your internal table and work area replace them in my sample code.

and one more thing dont forget to select EBELP component of EKPO.

Regards,

Dep

Former Member
0 Kudos

thanks for your help much appreciated

Former Member
0 Kudos

Hi,

Include the below code in a line above the text using Program lines

concatenate wa_itpotab-ebeln wa_itpotab-ebelp
into v_text1.

Regards,

Dep

Former Member
0 Kudos

thanks for your help.

I have an error message :

Field "V_TEXT1" is unknown. it is neither in one of the specified tables nor defined by a

DATA statement.

Clemenss
Active Contributor
0 Kudos

Hi HTO340,

In the smartforms global data area you can define V_TEXT1 TYPE STRING.

Regards

Clemens

Former Member
0 Kudos

Hi,

You need to declare V_TEXT1 in Global data of:

Global Settings > Global Definitions > Global Data

Variable Name : V_TEXT1

Type Assignment : TYPE

Associated Type : TEXT

while you are inserting below code Using Program Lines :

concatenate wa_itpotab-ebeln wa_itpotab-ebelp
into v_text1.

Check List:

1.You have to give this V_TEXT1 as Output Parameters of your Code Node ( Program Lines ).

2. wa_itpotab-ebeln wa_itpotab-ebelp as Input Parameters of your Code Node ( Program Lines ).

After this just save and activate.

Regards,

Dep

Former Member
0 Kudos

thank you for your help.

but I received an error messge about wa_itpotab,

the field wa_itpotab-EBELN is unknown, it is neither in one specified of the tables nor defined by a data statement.

Clemenss
Active Contributor
0 Kudos

HTO,

take a day off and study the link: [SAP Smart Forms (BC-SRV-SCR)|http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVSCRSF/BCSRVSCRSF.pdf].

To print a form, you need a program for data retrieval and a Smart Form that contains the entire

from logic. As data retrieval and form logic are separated, you must only adapt the Smart Form if

changes to the form logic are necessary. The application program passes the data via a function

module interface to the Smart Form. When activating the Smart Form, the system automatically

generates a function module. At runtime, the system processes this function module.

Defining the Form Interface

Use

You define the form interface to pass data to the form.

In the interface you can define import and export parameters, tables, and exceptions.

Prerequisites

The data retrieval program provides the data you want to include into the form. Therefore, you

know the types of the corresponding variables.

Global Definitions

Use

Global definitions apply for the entire form. You can use any objects defined there in all nodes of

the tree.

Features

The following global definitions are possible:

Variables or constants whose types are stored in the ABAP Dictionary

All this you will find in the pdf. No need to read all 110 pages if you understand a few.

Regards

Clemens

BTW: New to Smartforms? New to ABAP? New to SAP? New to - you name it -?

Former Member
0 Kudos

Hi,

First concantenate ekpo-ebeln and ekpo-ebelp and move it a variable and then give that variable as Text Name .

Refer Below Sample code:

concatenate wa_itpotab-ebeln wa_itpotab-ebelp
into v_text1.

So Text Name : &v_text1&

and rest same as you mentioned:

Text Object: EKPO

Text ID: F01

No error if no text exists: ticked

Regards,

Dep

Former Member
0 Kudos

Hi,

Check your TEXTNAME. It should be your PO number.

Jshree

Clemenss
Active Contributor
0 Kudos

Hi HTO,

smartformstrace will inform you - probably the text was not found due to any error right between keyboard and back of the seat.

Regards

Clemens

Former Member
0 Kudos

Hi,

If you go to the PO and look at the Item texts. place the cursor in the text window and hit the display icon or double click. Go->header. You should be able to figure out the text name(Combination of PO and POitem).

Thanks,

Vamshi

Former Member
0 Kudos

The textname should be the combination of PO name and item name. Please find the below link to know more about READ_TEXT

function module.

http://www.sap-basis-abap.com/sapac002.htm

Former Member
0 Kudos

What is the name you passed as text name?

Also try using READ_TEXT FM to read the item text.

Former Member
0 Kudos

thanks for your response

the name that I provide is a random one, as I did find any data in the match code.

there is no entry as READ_TEXT. what I have in the field Type: Include text, Text element, Text module, Dynamic text