1/17/2024 0 Comments Transtype in sap b1![]() ![]() " Dynamic Query - query string contains our fields and their respective valuesĬatch CX_SY_DYNAMIC_OSQL_SYNTAX into data(LX_DATA). Select * from ZEMPLOYEE where (QUERY_STRING) into table. "Using the parameter we could do whatever we want, like selecting from a table, doing certain calculations etc "fetching the parameter valueĬoncatenate QUERY_STRING 'and field name ' '=' LV_PARAM6 into QUERY_STRING separated by SPACE.Ĭoncatenate 'field name ' '=' LV_PARAM6 into QUERY_STRING separated by SPACE. LV_PARAM6 = value #( LT_FILTER_COND-VALUE optional ). "fetching the parameter valueĬoncatenate QUERY_STRING ' and field name ' '=' LV_PARAM5 into QUERY_STRING separated by SPACE.Ĭoncatenate 'field name ' '=' LV_PARAM5 into QUERY_STRING separated by SPACE. LV_PARAM5 = value #( LT_FILTER_COND-VALUE optional ). "fetching the parameter valueĬoncatenate QUERY_STRING ' and field name ' '=' LV_PARAM4 into QUERY_STRING separated by SPACE.Ĭoncatenate 'field name ' '=' LV_PARAM4 into QUERY_STRING separated by SPACE. LV_PARAM4 = value #( LT_FILTER_COND-VALUE optional ). "fetching the parameter valueĬoncatenate QUERY_STRING 'and field name ' '=' LV_PARAM3 into QUERY_STRING separated by SPACE.Ĭoncatenate 'field name ' '=' LV_PARAM3 into QUERY_STRING separated by SPACE. LV_PARAM3 = value #( LT_FILTER_COND-VALUE optional ). ![]() Ĭoncatenate QUERY_STRING 'and field name ' '=' LV_PARAM2 into QUERY_STRING separated by SPACE.Ĭoncatenate 'field name ' '=' LV_PARAM2 into QUERY_STRING separated by SPACE. If QUERY_STRING is not initial or QUERY_STRING ' '. LV_PARAM2 = value #( LT_FILTER_COND-VALUE optional ). "fetching the parameter valueĬoncatenate 'field name ' '=' LV_PARAM1 into QUERY_STRING separated by SPACE. LV_PARAM1 = value #( LT_FILTER_COND-VALUE optional ). "setting the filter condition, fetching parameter names from data definition "standard method to get incoming dataĭata(LT_FILTER_COND) = IO_REQUEST->GET_PARAMETERS( ). "internal table to be returnedĭata: LV_PARAM1 type STRING, "Local variables to fetch and save parameter value Implementation / Class : class ZCL_CUSTOMENTITY definitionĭata:IT_RESULT type table of ZCUSTOMENTITY. Key id : abap.char(10) // Returning fields are mentioned between just like ordinary CDS So I decided to go with something similar to classic ABAP dynamic select Query.ĭata Definition For custom Entity : : 'ABAP:ZCL_CUSTOMENTITY' No guarantee that a parameter would have value at specific time.If the parameter is empty, never add the parameter ( If parameter is empty it would result in where = null value, adding a null value in selection criteria will return wrong result set ) to the where condition.Will be having almost 6 parameters (May be more).A few days back, I came across a scenario which required a dynamic where condition for a select query to return data via a Custom Entity ( Please read more about Custom Entities here -> ). ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |