on 07-30-2010 9:51 AM
Hi ALl,
I have to pass two fields into the smartform dynamically on that basis i have to receive the fielsds as well as their texts in my out put.
for example matnr from mara on th ebasis of matnr i hvae to get in my output matnr as well as maktx.
its urget please help needed
i have a sample for that but i am not getting how to do. here I am providng you th esample for this.
I am getting the problem while looping in the form.
Settings:
Definition of TEXT variable anywhere in Interface or Global definitions.
Variable name : TEXT
Type assignment : TYPE
Associated tyep : TSFTEXT
In text node you need to have the following settings:
Text type : Dynamic Text
Field Name : &TEXT&
Language : EN
Program lines anywhere before the node is processed:
DATA : LS_LINE TYPE TLINE.
LS_LINE-TDFORMAT = '*'.
LS_LINE-TDLINE = 'LINE1'.
APPEND LS_LINE TO TEXT.
LS_LINE-TDFORMAT = '*'.
LS_LINE-TDLINE = 'LINE2'.
APPEND LS_LINE TO TEXT.
LS_LINE-TDFORMAT = '*'.
LS_LINE-TDLINE = 'LINE3'.
APPEND LS_LINE TO TEXT.
thanks in advance
have resolved this issue by my own.
thanks Flourien for all feed back.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
i sense you are completeley on the wrong track, or i have problems in understanding where you are stuck.
maktx is just a char40 MAKT field, you can select it from table MAKT with key MATNR & SPRAS.
what i dont understand is why you are trying to build a text here? I mean once you got the values of MATNR and MAKTX you can print them, no need for a include text node then.
either you wait for other answers or you try to elaborate a bit deeper what your requirement is.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI Florian,
Actually the requirement is I have to pass dynamically MATNR on that basis I have to retreive MATNR as wel as MAKTX in my form
For this I decalred in my form interface matnr like S_matnr (this S-matnr i have declared in the print program in my select-options.
now in my mat window I have declared these two field s but unable to pass inot the loop.
I am fetching the data in the form it self.
ah ok now i get a better idea what you are about to do.
So you are doing the COMPLETE data selection ( the GET_DATA) part in your smartforms and then build yourself a table over which you loop and print the table contents (i guess items).
Now you need to add MATNR and MAKTX in item print (or record print), correct?
now what is important, do you use a table, or a template?
if you use a table, you need to add those fields to the line type, and in the line you can then add your variables.
if you use a template, it should be enough to add your fields to the structure in which you loop.
anyway feel free to ask more if you still got problems, hope i could help at least enough to get sorted out where the real problem lies
Yes Florian,
I think you got what my requirement is. I am facing the problem while declaring in my loop.
from the very beginign i m explaining you what i have done till now.
at the very first
1.i declared in the form interface jy matnr like s_matnr. (this s_matnr i have decalred in the driver program select-options)
2. in program lines i have coded in thhis way.
TABLES: MARA,MAKT.
DATA: BEGIN OF IT_ITAB occurs 0,
MATNR TYPE MARA-MATNR,
MAKTX TYPE MAKT-MAKTX,
END OF IT_ITAB.
SELECT MATNR FROM MARA INTO TABLE IT_ITAB WHERE MATNR in S_MATNR.
IF SY-SUBRC = 0.
SELECT MAKTX FROM MAKT INTO TABLE IT_ITAB
FOR ALL ENTRIES IN IT_ITAB-MATNR.
but i ma getting error .
bcoz i have not decalred any thing in the lop of smart form. so what i have to declare i m not getting .
the above code is my in smart form.
the below is from my driver program.
TABLES: MARA,MAKT.
SELECT-OPTIONS: S_MATNR FOR MARA-MATNR.
DATA: V_SPOOLID TYPE SSFCRESCL,
V_SPOOLNO TYPE RSPOID.
DATA: FM_NAME TYPE RS38L_FNAM.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = 'ZFORM'
IMPORTING
FM_NAME = FM_NAME.
call function fm_name
importing
S_MATNR = S_MATNR
job_output_info = v_spoolid
tables
S_MATNR = S_MATNR.
loop at v_spoolid-spoolids into v_Spoolno.
endloop.
submit rstxpdft4 with spoolno = v_spoolno.
thanks for ur valuable reply
sorry but i stopped at: "but i ma getting error ."
What kind of error do you get? a syntax error when compiling or what?
anyway your selects has a problem.
SELECT MATNR FROM MARA INTO {color:red}CORRESPONDING FIELDS OF {color} TABLE IT_ITAB WHERE MATNR in
S_MATNR.
SELECT MAKTX FROM MAKT INTO TABLE IT_ITAB
FOR ALL ENTRIES IN IT_ITAB-MATNR.
but it should read
SELECT MAKTX FROM MAKT INTO {color:red}CORRESPONDING FIELDS OF {color} TABLE IT_ITAB
FOR ALL ENTRIES IN IT_ITAB-MATNR.
maybe we should approach step by step
well what kind of error do you get? syntax error when compiling? Dump when printing?
maybe even tell us what the error message is. Once we know that we can resolve this error, and see how far you get then until the next error pops up.
and then analysing next error, and solving it and so on, step by step.
Problem now is that i´m not really sure where you are stuck, and the message that you get "an error" doesnt really help me to identify the problem.
Hey Florian,
i m geeting syntax error in my program lines.matnr as well as s_matnr is unknpown.
Also in loop matnr into S_matnr in unknown.
So what i m asking you where rto declarer the declaration for fileds.
in form interrface i declaered in tabl e parameter
matnr like s_matnr
Just confused how to code in loop. the way I am providning its says S-matnr is unknopwn.
In loop I have given
matnr into matnr
What shall be there in the loop.
After receiving your reply whether i have declaredin table or template. I declared in table then declared the 2 field.
here i have struckedin the form. my print program is fine no errors.
@8O@ %LOOP1 Name of the internal table must be specified
@8O@ %LOOP2 Field "MATERIAL" is unknown. It is neither in one of the specified tables nor defined by a "DATA" statement . . . . . . . . . .
@8O@ %TEXT3 Field "MARA-MATNR" is unknown. It is neither in one of the specified tables nor defined by a "DATA" statement . . . . . . . . .
@8O@ %TEXT4 Field "MAKT-MAKTX" is unknown. It is neither in one of the specified tables nor defined by a "DATA" statement . . . . . . . . .
@8O@ %PAGE1 A page without a main window cannot point to itself as next page
@8R@ %TEXT3 Field mara-matnr has no defined value
@8R@ %TEXT4 Field makt-maktx has no defined value
these are the errores what io m getting.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.