05-10-2006 8:30 AM
how do we do the following in sap smart forms ?
DATA: BEGIN OF G_T_ITAB OCCURS 10.
INCLUDE STRUCTURE TLINE.
DATA: END OF G_T_ITAB .
AND
CALL FUNCTION 'READ_TEXT'
EXPORTING
ID = 'F05'
LANGUAGE = 'E'
NAME = 'sum text'
OBJECT = 'EKPO'
TABLES
LINES = G_T_ITAB
EXCEPTIONS
ID = 1.
IF SY-SUBRC <> 0.
ENDIF.
secondly how do then go on using G_T_ITAB to get the fields in it ?
thanks for yur time,
Shehryar
05-10-2006 10:19 AM
HI
GOOD
YOU HAVE NOT CLEARLY MENTIONED WHAT IS YOUR REQUIREMENT IS ,ANYWAY THE CODE YOU HAVE MENTIONED HERE CAN BE USED IN DRIVER PROGRAM IN THE SMART FORMS .
THE INTERNAL TABLE THAT YOU HAVE DECLARE HERE CAN BE PASS AS THE TABLE PARAMETERS IN THE SMARTFORMS SCREEN.
ITAB NAME TYPE WA
THANKS
MRUTYUN
05-10-2006 8:33 AM
Hi
Use an text node where it directly call the std text:
Choose "Include Text" option and in the field Text Name, Text Object, Text Id and language insert the data header of your text.
If the text has to be called dinamycally, you can use some variable where store the data header and transfer to the smartforms:
Text Name = &TEXT_NAME&
Text Object = EKK0
.....
Max
05-10-2006 8:38 AM
Hi Shehryar Dahar,
Declare a type in the TYPES tab as follows,
*>>>Table type to read text objects.
types: ty_textobject type standard table of tline.
Then you can use <b>ty_textobject</b> in the associated type to declare tables in the Global Data tab.
Then you have to use a program lines in to call the READ_TEXT function module.
Thanks and Regards,
Bharat Kumar Reddy.V
Message was edited by: Bharat Kumar Reddy Vaka
Message was edited by: Bharat Kumar Reddy Vaka
05-10-2006 9:44 AM
Hi Shehryar ,
Go through these steps.
1. Go to <b>GLOBAL DEFINITIONS->TYPES</b>
Here define ur internal tables and structures
ex.
Types:BEGIN OF w_tline.
INCLUDE STRUCTURE TLINE.
Types: END OF w_tline.
Types :i_tline TYPE STANDARD TABLE OF w_tline.
Again create global Structures and internal tables to
use everywhere under <b>GLOBAL DATA</b> tab.
2. To use that FM READ_TEXT .
first decide where do u want use.
=>Right click on that node
b]->Create->Flow Logic->Program Lines</b>
give input and ouput parameters here and use ur FM
and ur ITAB.
3. Click on Field list On/Off(CTRLSHIFTF4) button on
Application tool bar.Go thru EXPORT ,IMPORT and GLOBAL
DATA (here u will find fields in the table )
I think it helps you.
<i><b>Best Regards,
Venkat.O</b></i>
05-10-2006 10:19 AM
HI
GOOD
YOU HAVE NOT CLEARLY MENTIONED WHAT IS YOUR REQUIREMENT IS ,ANYWAY THE CODE YOU HAVE MENTIONED HERE CAN BE USED IN DRIVER PROGRAM IN THE SMART FORMS .
THE INTERNAL TABLE THAT YOU HAVE DECLARE HERE CAN BE PASS AS THE TABLE PARAMETERS IN THE SMARTFORMS SCREEN.
ITAB NAME TYPE WA
THANKS
MRUTYUN
05-10-2006 12:03 PM
Dear Venkat,
what do u mean by ,
Again create global Structures and internal tables to
use everywhere under GLOBAL DATA tab.
can u demonstrate plz ?
05-10-2006 12:13 PM
Dear Bharat,
i have donr this as u told me.
types: ty_textobject type standard table of tline.
then in the global definition i have declared,
itab type ty_textobject
then i have called the FM read_text in a progam line as,
CALL FUNCTION 'READ_TEXT' " FM Read_text
EXPORTING
ID = 'F01'
LANGUAGE = 'E'
NAME = txt
OBJECT = 'EKPO'
TABLES
LINES = itab
EXCEPTIONS
ID = 1.
IF SY-SUBRC <> 0.
ENDIF.
then i display from the itab as , &itab-tdline& in a text.
but when i activate the form , i get this error:
"ITAB" is a table without a header line and therefore has no component called "TDLINE".
Field ITAB-TDLINE has no defined value
where am i wrong?
05-10-2006 12:22 PM
i did use max's way,
i wrote -> Text Name = &TEXT_NAME& is the Text Name field, but it gives a blank output. But it gives me an output when i write TEXT_NAME in the Text name field.
05-10-2006 12:34 PM
Hi
You should have a structure (perhaps like THEAD) where the header data of std text are stored in your smartform.
So:
- create a TEXT node in your window;
- In General Attribut choose Include Text option (as Text type);
- In "Text Key" area you have to insert the text keys:
if they are stored in some variables, press the pushbutton on the left and after insert the variable name
- Before the text node, you should create an code note to fill the variables with the keys of the texts.
In your case it seems the text id, text object and language are costants, while you've to find the name, so:
- ABAP Node: code to determine the name:
CONCATENATE EKPO-EBELN EKPO-EBELP INTO V_NAME
- Text Node:
Text Name -
> &V_NAME&
Text Object -
> EKPO
Text ID -
> F05
Language -
> E
Before inserting &V_NAME&, press the pushbutoon on the left.
Max
05-10-2006 12:39 PM
press the pushbutton on the left and after insert the variable name
there's no pushbutton on the left ..?
05-10-2006 12:44 PM
Hi
Excuse me the button is on the right, it has an arrow as incon
Max
05-10-2006 1:03 PM
Hi shehryar dahar,
After using READ_TEXT you have to take a loop node. In this loop you have to pass ITAB and a work area, suppose, WA_ITAB of type TLINE and print WA_ITAB-TDLINE. This may solve your problem...
Thanks and Regards,
Bharat Kumar Reddy.V
05-10-2006 1:06 PM
shud i write the variable manually or use the field on/off thing.
05-10-2006 1:19 PM
Dear MAx,
u wrote , CONCATENATE EKPO-EBELN EKPO-EBELP INTO V_NAME
what will be the datatype of v_name when ekpo-ebeln is a char and ekpo-ebelp is a numc ?
05-10-2006 1:22 PM
Hi
Create that variable in global data section like THEAD-TDNAME.
The name of text of type EKPO is usually format by purchase and item number.
Max
05-11-2006 6:47 AM
dear max,
i have done like this,
v_name type tead-tdname in the global data
In Initialization tab, i have done..
CONCATENATE EKPO-EBELN EKPO-EBELP INTO V_NAME
when i display V_NAME to check its value, its is showing me 00000 in it, which obviously the FM cannot accept.
05-10-2006 12:11 PM
Hi,
Use the solution suggested by Max, to get standard text.
(Efficient way ...)
You can avoid declaring and writing the code using FM READ_TEXT.
Regards,
Raj
05-10-2006 2:00 PM
Hi Shehryar ,
Looks like u want to read standard text from PO and display in SMART FORMS if I am correct, U can follow this method to display:
1. Create a Text
2. In <b>General Attribute Tab</b>
3. Click on <b>Type</b> and Select <b>Include Text</b>
4. Next u need to input the values in the corresponding
text boxes
Text NAME = <Valid name>
Text Object = EKPO
Text ID = F01
LANGUAGE = EN
To Get PO Item Text
Regards,
Kalyan