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

How to create code for an additional field in an info set

Former Member
0 Likes
2,753

Hello,

I have an info set in tra SQ02 and the area is HCM with version ERP2004.

I need to create an additional field to show "Work permit" in ad hoc queries. I know that the infotype 0016 has a standard field P0016-ARBER which contains a date if that person has a work permit. System should select the latest record or the one which is valid during reporting period.

The requirement for this new field is that it should just has X if the field P0016-ARBER contains a date (i.e. that person has a work permit). If the field P0016-ARBER is empty, then the new field "Work permit" is also empty. So, the date itself is not enough.

I am not an abaper. I have tried to create a code for my field but there is always problems with the code. I have tried without the line<i>into</i> but checker says I need to. I have tried different places for statement ENDSELECT but without success. How should I do this?

What I have so far is (TYOLUPA = Work permit) is shown below:

select SINGLE ARBER

into TYOLUPA

from PA0016

where pernr = P0016-pernr

and ENDDA = '31129999'.

clear TYOLUPA.

if ARBER ne ''.

then TYOLUPA = 'X'.

endif.

Thanks for your advice!

Regards,

Pipsa

3 REPLIES 3
Read only

Former Member
0 Likes
1,307

pia,

In extras tab create column "workpermit" in infoset and add that column to Field groups.

Then under record processing event...

DATA : TYOLUPA like PA0016-ARBER.

Under Record processing event.

select SINGLE ARBER

into TYOLUPA

from PA0016

where pernr = P0016-pernr

and ENDDA = '31129999'.

if TYOLUPA ne ' '.

WORKPERMIT = 'X'.

endif.

Don't forget to reward if useful...

Read only

0 Likes
1,307

Hi,

Unfortunately your answer is not working. Sceondly, why should I set TYOLUPA like PA0016-ARBER when the latter is a date field (type D) and my new field is not? Did you mean P0016-ARBER? Neither of the options work.

Regards,

Pia

Read only

shishupalreddy
Active Contributor
0 Likes
1,307

Hello ,

Once u have added the additional field to the infoset

right click on the field and select Fieldcode there u will find the editor .

in the editor u can write the code .

regards,