10-25-2006 8:36 AM
I have a requirement for using custom SAPSCRIPT for booking confirmation in Training and event management module..
One of them is fetching data from standard structure PPVAR (form parameters).But I need to modify the SAPscript and put some variables which are not present in PPVAR.There is another structure PPVARC which is for custom variables.
I found in Spro that we can define our custom variables in CI_PPVARC include in PPVARC structure.
while I created the custom field(Description) through that wizard
It created a subroutine <b>YHKRMIT30</b>(Name was given by me)
inside that subroutine it created a subroutine named <b>GET_Text</b>.
My question is:
I want to output this field:
in the form I wrote :&PPVARC-TEXT&
in the program(YHKRMIT30) I wrote:
....
gw_vdtab-dataset = 1.
LOOP AT t_course INTO w_course.
gw_vdtab-data = w_course.
gw_vdtab-dataset = 1.
APPEND gw_vdtab.
ENDLOOP.
....
data in table t_course is like:
name1 tel1
name2 tel2
name3 tel3
...
how to disply many lines in the form? becourse use the above code,just can list one line in the form.
what's the exactly meanings of gw_vdtab-dataset = 1.
can I put the second line data into gw_vdtab,use
gw_vdtab-dataset = 2?but in the form i just can write :&PPVARC-TEXT& how to display the other data?
Message was edited by: yang
10-25-2006 8:56 AM
Hi
I'm not sure but u should implement the counter dataset for every new lines you have to print and in the field TBNAM and FIELD insert the fields to be printed.
LOOP AT t_course INTO w_course.
gw_vdtab-TBNAM = <structure name>
gw_vdtab-FIELD = <field name to be printed>
gw_vdtab-data = w_course.
APPEND gw_vdtab.
ENDLOOP.
Max
10-25-2006 9:06 AM
your method is the same as I did:
LOOP AT t_course INTO w_course.
gw_vdtab-TBNAM = 'PPVARC'.
gw_vdtab-FIELD = 'TEXT'.
gw_vdtab-data = w_course.
APPEND gw_vdtab.
But the second line will cover the first line.
yes,If the table have 10 lines,I write 10 subroutines is ok,in the form:&PPVARC-line1&,&PPVARC-line2&..&PPVARC-line10&
But It's too complex.Is anyone have a good idea?
Now,I can put 10 line in 10 datasets(from 1 to 10),
but in the form,I just can use :&PPVARC-text&,how to differentiate different lines? It just disply line1.
Message was edited by: yang
10-25-2006 9:29 AM
Hi
I don't know very well the trx you're using but see the fm RH_FORM_OUTPUT here you can see how the form and its elements are called.
The problem is always used the option APPEND: it means the data should be write in the same line for a certain element.
Max
10-25-2006 9:44 AM
ok,make the question simply:
now in the <b>gw_vdtab</b> data is like this:
<b>TBNAM-FIELDDATASET--DATA</b>
PPVARC-TEXT--- 1 -
text(line 1)
PPVARC-TEXT--- 2 -
text(line 2)
PPVARC-TEXT--- 3 -
text(line 3)
and in the form:I write: &PPVARC-TEXT&
the result is: text(line 1)
I want to list all the data,how to do it?
how to identify different DATASET?
Message was edited by: yang
10-25-2006 10:20 AM
Hi
I understand it, but I can't try your trx or give me the trx you run the print.
I believe the fm RH_FORM_OUTPUT manages the print and here the fm WRITE_FORM is called if:
- DATASET of current record is different from nex record;
- WDTEGR of current record is different from nex record;
So I seem you transfer the data in right way
Try to set a break-point in that fm to understand how it manages the print.
Max