cancel
Showing results for 
Search instead for 
Did you mean: 

How to access a field of an data source w/o binding a form field to it

Former Member
0 Kudos

Hi

This is a query regarding ADOBE print form.

How to access a record field (of an data source.... typical multi row records) where the record is bound to a subform.

Data is something like

(I have used abap parlance for understanding)


data : begin of data_tab occurs 0,
  field1 type .....,
field2 type .....,
......
....
fieldm type .....,
fieldn type .....,
end of data_tab.

Subform is bound to 
$.DATA_TAB.DATA[*]

How to access field1, field2,...... etc without creating subform fields and binding them to field1, field2, .... fieldn.

I know normal approach is to define subform fields and then bind it to $.field1, $.field2 etc

In the calculate event of a field bound to $.fieldm I have tried the following expressions to get the value of column fieldn of the same record but none of them worked.... Note that if I bind the field using $.fieldn data is displayed properly in the print form.


$record.data_tab.fieldn.value
$record.data_tab.data[*].fieldn.value
$record.data_tab.data.fieldn.value 
$record.data_tab.fieldn.value

Otherwise I would have to define hidden fields just to use these column values in the event script even though these value are not to be displayed in the ADOBE print form.

Regards

Abapper

Accepted Solutions (0)

Answers (1)

Answers (1)

andrs_sarcevic
Contributor
0 Kudos

I can't remember the exact sentence, but do a little search, as that is a common question in this forum....

How about:

 
$record.data_tab.data[1].fieldn.value
$record.data_tab.data[2].fieldn.value
$record.data_tab.data[2].fieldn.value
[...]
$record.data_tab.data[N].fieldn.value

Cheers.

Former Member
0 Kudos

Hi,

In form calc, you can use the below way to access the field.

$record.FIELD_NAME.DATA[*].FIELD

In javascript, you can use the below syntax.

xfa.record.FIELD_NAME.DATA.FIELD.value

Thanks,

Aravind