cancel
Showing results for 
Search instead for 
Did you mean: 

Implementing Read and Query operation using segw

amar82158
Explorer
0 Kudos

Hi experts,

              Can anyone tell me how can I perform read and query operation together in service made using SEGW t-code.

I have following function module which accepts number of rows and gives the list of usernames.

I have implemented read and query operations individually but not in same service.

Thanks and regards.

Accepted Solutions (1)

Accepted Solutions (1)

ChandraMahajan
Active Contributor
0 Kudos

Hi Amar,

you need to create service and implement GET_ENTITY and GET_ENTITYSET methods for read and query operation.

Now you can use FM BAPI_USER_GET_DETAIL in your method GET_ENTITY and BAPI_USER_GETLIST in method GET_ENTITYSET.

For GET_ENTITY, you need to read the value of  USERNAME which will be your key attribute.

I hope with this info, you can achieve required functionality.

Regards,

Chandra

amar82158
Explorer
0 Kudos

Hi Chandrashekhar,

Thanks for the reply.

Can you please give step wise procedure in form of screenshots.

ChandraMahajan
Active Contributor
0 Kudos

Hi Amar,

As I am busy with other stuff, I will not be able to provide screenshots. I will provide you detailed steps by which you can perform required functinality.

1) Go to SEGW. Create project for e.g. ZUSERS. create entity as user with dictionary structure BAPIUSNAME.

2) Mark USERNAME as key property.

3) Create entity set as userset for entity user

4)generate runtime artifacts. you will get DPC_EXT class created.

5)Redefine method userset_get_entity and userset_get_entityset.

6)userset_get_entity --> Here you can read the value of username and fill the er_entity exporting paramater. you will get the value of username from it_key_tab importing parameter.

READ TABLE IT_KEY_TAB WITH KEY USERNAME = 'XYZ' INTO ls_key.

    lv_username = ls_key-value.

CALL FM 'BAPI_USER_GET_DETAIL'

EXPORTING lv_username  (etc.... logic)

7)userset_get_entityset ---> Here you will get value of max rows from IS_PAGING-TOP importing parameter. use FM BAPI_USER_GETLIST and fill the ET_ENTITYSET.



Let me know if you need any more information.


Regards,

Chandra

amar82158
Explorer
0 Kudos

Thanks Chandrashekhar,
i will try this out and will let you know, thanks for your time.

Answers (0)