2022 Jul 22 4:38 AM
SELECT MSG~EBELN, " MSEG-EBELN, " new line insrted for po for at end of work
VRP~WERKS, " VBRP-WERKS,
getting issue while using MSG~ZEILE = RIGHT(VRP~VGPOS ,4) inside the code, because both mseg and vbrp field are numeric but field leanth is differnt how to write that particular code.
2022 Jul 22 7:21 AM
Define the SQL functions at the left-hand side of the conditions, not at the right-hand side.
This is correct:
WHERE ... RIGHT( VRP~VGPOS,4 ) = MSG~ZEILE ...
This is wrong:
WHERE ... MSG~ZEILE = RIGHT( VRP~VGPOS,4 ) ...
NB: SQL functions start working from ABAP 7.50 (e.g. RIGHT) Some functions are added in later ABAP versions.
2022 Jul 22 7:00 AM
Just a legibility remark: what is the interest of using alias VBR for table VBRK, VRP for table VBRP, MSG on MSEG, etc.? Just to confuse the reader? Why don't you just NOT define aliases, and just keep the full names VBRK, VBRP and MSEG everywhere?
2022 Jul 22 7:21 AM
Define the SQL functions at the left-hand side of the conditions, not at the right-hand side.
This is correct:
WHERE ... RIGHT( VRP~VGPOS,4 ) = MSG~ZEILE ...
This is wrong:
WHERE ... MSG~ZEILE = RIGHT( VRP~VGPOS,4 ) ...
NB: SQL functions start working from ABAP 7.50 (e.g. RIGHT) Some functions are added in later ABAP versions.