cancel
Showing results for 
Search instead for 
Did you mean: 

HCM forms and tables

Former Member
0 Kudos

Hi

I implemented backend service to read all wage types for employee.

I would like to return the table of wage types through variable in my custom backend service and not create n sets of variables to return the data.

Is this possible to implement using HCM forms?

Accepted Solutions (0)

Answers (1)

Answers (1)

ChrisSolomon
Active Contributor
0 Kudos

Yes. Use a "line type" structure. I have done this EXACTLY with wage types many times now.

Former Member
0 Kudos

thank you for reply.

So i specify line_type as my variable type (ASR_FIELD_DATA_ELEMENT_NAME)

I want to return this in my initialize event.

after loading the wages type I then need to assign the table to my backend service variable

something like

LOOP AT service_field_values INTO service_dataset_wa WHERE fieldname = C_TESTTABLE_FIELDNAME.

service_dataset_wa-fieldvalue = lt_ppbwla.

MODIFY service_field_values INDEX sy-tabix FROM service_dataset_wa TRANSPORTING fieldvalue.

ENDLOOP.

But this will not work as service_dataset_wa-fieldvalue is of type string.

Also, when editing the form itself and wanting to drag my newly created varialbe onto the form, it does not create table but only single variable.

My apologies if any/all of above are stupid... im still learning HCM forms... the hard way...

Just as I figure out 1 thing.. there is more....

I think you said it... "there is more question than answers"

Former Member
0 Kudos

Hi F. van der Merwe,

It is possible to use table to store list of record belong to same variable, eg list of wage type.

There are 4 columns( FIELDGROUP, FIELDNAME, FIELDINDEX, FIELDVALUE) in service_datasets.

FIELDVALUE is a string type variable and it will never give you value with table type.

You need make use of FIELDINDEX, to make a store list of value for same variable but having sequential index in service dataset table.

Eg,

FIELDGROUP FIELDNAME FIELDINDEX FIELDVALUE

FG_1 LGART 1 0001

FG_1 LGART 2 0005

FG_1 LGART 3 0007

FG_1 LGART 4 0010

..

Hope this helps.

regards,

Xiang Li