Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Node Syntax Error

Former Member
0 Likes
695

Hello,

I am writing a piece of code based on the PNP logical database. I have declared a NODE

as:

NODES: payroll TYPE paygb_result.

I can refer to fields in the INTER component i.e. DATA: wa_rt LIKE LINE OF payroll-inter-rt

but when I refer to the part which is country specific

i.e. DATA: wa_pens LIKE LINE OF payroll-nat-pens

the syntax checker is saying that "PAYROLL" does not have a component called "NAT_PENS".

I can double click on paygb_result which shoes a component called NAT. Then clicking on

PAYGB_NATIONAL then displays the component PENS.

Can anyone tell me why this is happening?

Any help much appreciated.

Andy

1 ACCEPTED SOLUTION
Read only

Pawan_Kesari
Active Contributor
0 Likes
660

try this

TYPES : t_rt  TYPE LINE OF paygb_result-inter-rt ,
        t_pen TYPE LINE OF paygb_result-nat-pens .

DATA: wa_rt TYPE t_rt .
DATA: wa_pens TYPE t_pen .

5 REPLIES 5
Read only

Pawan_Kesari
Active Contributor
0 Likes
661

try this

TYPES : t_rt  TYPE LINE OF paygb_result-inter-rt ,
        t_pen TYPE LINE OF paygb_result-nat-pens .

DATA: wa_rt TYPE t_rt .
DATA: wa_pens TYPE t_pen .

Read only

0 Likes
660

Thanks very much for replying,but how do I now look at the results?

If I say:

LOOP AT paygb_result-nat-pens INTO wa_pens.

ENDLOOP.

I now get another syntax error.

Many thanks

Read only

0 Likes
660

Managed to solve it.

Many, many thanks mate. You have solved a very big headache!!!!

Cheers

Read only

0 Likes
660

Hi,

I have checked in ECC 6 and no errors came.

Please check the bleow code.

data : payroll type paygb_result.

data: wa_pens like line of payroll-nat-pens, ( or)

wa_pens type PC22P.

LOOP AT payroll-nat-pens INTO wa_pens.

ENDLOOP.

In Loop at you have to specify the declared Node name ( i.e. payroll )but you specified the reference structure ( i.e. paygb_result-nat-pens ) which is wrong.

Please check that.

Regards,

Sunil

Read only

MarcinPciak
Active Contributor
0 Likes
660

Hi,


NODES: payroll TYPE paygb_result.

This statement uses table which is only known to system at runtime.

In order you could address fields of this table (only NAT component which is country specific) you must declare another one of the same paygb_result type.


data: it_pens TYPE paygb_result-nat-pens,   
        wa_pens LIKE LINE OF it_pens.  "using PAYROLL here, system will not recognize it, hence the syntax error

"now you can address WA_PENS fields here

As you noticed you can, however address component payroll-inter-rt , becasue it is non country specific, so is available for all payroll result types ( paygb_result , paynl_result , paypl_result etc ).

Regards

Marcin