cancel
Showing results for 
Search instead for 
Did you mean: 

How to add new field in the select statement with new abap 7.4 syntax?

rakesh_94
Participant

SELECT rdoc, exnum, exdat, rind, cancel

FROM j_1iexchdr as a
INTO TABLE @DATA(it_j_1iexchdr)
FOR ALL ENTRIES IN @it_vbrk_vbrp
WHERE rdoc = @it_vbrk_vbrp-vbeln
AND trntyp = 'DLFC'
AND rind = 'N'.

Here i want to add cancel field which is not in the structure or table , if we use structure there we can define cancel type c and we can use but how to do it with new sysntax?

matt
Active Contributor

This made me smile. 7.4 isn't new!

But my employer has only recently stopped supporting 7.31, so I get it. 😄

Ulrich_Schmidt
Product and Topic Expert
Product and Topic Expert

Doesn't look like this is related to HTTP or RFC communication?! Removing "ABAP Connectivity".

Accepted Solutions (0)

Answers (1)

Answers (1)

Madjid
Participant
0 Kudos

Hello
you can use
"" as cancel

or

"0" as cancel
with this method you have a null field or a field with "0" value

beast regards

Sandra_Rossi
Active Contributor
0 Kudos

It's single quotes, not double quotes...

you can use

'' as cancel

or

'0' as cancel
Sandra_Rossi
Active Contributor
rakesh_94
Participant
0 Kudos

nope its not working

Sandra_Rossi
Active Contributor
0 Kudos

rakesh_94 Please show your code and explain what is "not working". Syntax error? Which message? Something else?

rakesh_94
Participant
0 Kudos

@sandra.rossi

rakesh_94
Participant
0 Kudos

sandra.rossi ..code snippet is added pls check

Sandra_Rossi
Active Contributor
0 Kudos

oh, too bad. SQL expressions are forbidden with FOR ALL ENTRIES (in your case, the literal ' ' or '0' or 0 is the SQL expression):

ABAP documentation - SELECT, FOR ALL ENTRIES

In general, SAP probably wants to deprecate FOR ALL ENTRIES, almost everything new is forbidden with FAE.

Alternatives: GTT, join.

With Eclipse ADT, it's easy to declare IT_J_LIEXCHDR with more fields (by refactoring/quick fix + define your field). Or do it manually (or with the "pattern" tool).