Application Development 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: 

BOPF convert the select statement to query

bolivs22
Participant
0 Kudos

Hello how to convert this select statement to bopf query? i am new in BOPF and im not knowledgeable yet please help or give me ideas

this is my select query. i also dont know what to call in the query the current query key i know is the root->root_elements but for the other tables i don't know what to put .
table : /SCMTMS/D_TORDRF ,

SELECT SINGLE BD_KEY

FROM /SCMTMS/D_TORROT

INTO LV_DB

WHERE TOR_ID : FO/FB number display.

IF SY_SUBC = 0.

SELECT SINGLE BTD_ID

FROM /SCMTMS/D_TORDRF

INTO LV_BTD

WHERE PARENT_KEY = LV_DB

AND BTD_TCO = ‘73’ OR ‘58’.

IF LV_BTD INITIAL.

SELECT SINGLE BTD_ID

FROM /SCMTMS/D_TORDRF

INTO LV_BTD

WHERE PARENT_KEY = LV_DB

AND BTD_TCO = ‘114’.

ENDIF.

ENDIF.

1 ACCEPTED SOLUTION

saundattikar
Participant
0 Kudos

Hi Aaron,

If I understand correctly, you want to read document references for a TOR Object. Instead of creating custom query, you can try using the standard helper method:

Class: /SCMTMS/CL_TOR_HELPER_READ
Method: GET_TOR_DATA

You can pass the TOR DB_KEY in the importing parameter and the exporting parameter ET_DOC_REFERENCE will give you the desired data.

Thanks

Rohan

1 REPLY 1

saundattikar
Participant
0 Kudos

Hi Aaron,

If I understand correctly, you want to read document references for a TOR Object. Instead of creating custom query, you can try using the standard helper method:

Class: /SCMTMS/CL_TOR_HELPER_READ
Method: GET_TOR_DATA

You can pass the TOR DB_KEY in the importing parameter and the exporting parameter ET_DOC_REFERENCE will give you the desired data.

Thanks

Rohan