2021 Feb 11 1:37 PM
I have a ABAP program in development environment, and it works fine in development and quality SAP environmnet, but when I transport it to production environment, I get the problem:
And when I try activate the program direct in production environment I get the error:
The two logs said about SQL syntax error, so I try several different strategies for my Open SQL select, such as 'IN', 'FOR ALL ENTRIES', 'LOOP AT', etc., all strategies work fine in development and production, but all get wrong with this same error during transport to production.
What must I do for my ABAP program get away from this error?
This is my Open SQL query:
SELECT
VBAK~VBELN,
VBAK~ERDAT,
VBAK~AUART,
TVAUT~BEZEI,
VBFA~VBELN,
VTTK~SHTYP,
' ',
LIPS~MATNR,
MAKT~MAKTX,
LIPS~LFIMG,
LIPS~VRKME,
T178T~VTEXT,
0,
' ',
MARA~NTGEW
INTO TABLE @TI_VBAK
FROM VBAK
INNER JOIN VBAP ON VBAP~VBELN = VBAK~VBELN
INNER JOIN VBFA ON VBFA~VBTYP_N = 'T' AND VBFA~VBELV = VBAK~VBELN
INNER JOIN LIPS ON LIPS~VBELN = VBFA~VBELN AND LIPS~POSNR = VBFA~POSNN AND LIPS~MATNR = VBAP~MATNR
LEFT JOIN VTTP ON VTTP~VBELN = LIPS~VBELN
LEFT JOIN VTTK ON VTTK~TKNUM = VTTP~TKNUM
LEFT JOIN TVAUT ON TVAUT~SPRAS = 'P' AND TVAUT~AUGRU = VBAK~AUGRU
LEFT JOIN MVKE ON MVKE~MATNR = LIPS~MATNR AND MVKE~VKORG = VBAK~VKORG AND MVKE~VTWEG = VBAK~VTWEG
LEFT JOIN T178T ON T178T~SPRAS = 'P' AND T178T~KONDM = MVKE~KONDM
LEFT JOIN MAKT ON MAKT~MATNR = LIPS~MATNR AND MAKT~SPRAS = 'P'
LEFT JOIN MARA ON MARA~MATNR = LIPS~MATNR
WHERE VBAK~ERDAT IN @S_DATE
AND VBAK~AUART IN ( 'ZDAA',
'ZDAE',
'ZDAP',
'ZDAT',
'ZDBE',
'ZDBP',
'ZDCE',
'ZDCJ',
'ZDCP',
'ZDCS',
'ZDEX',
'ZDFA',
'ZDFE',
'ZDFF',
'ZDFP',
'ZDFR',
'ZDFT',
'ZDFV',
'ZDLE',
'ZDLP',
'ZDME',
'ZDMP',
'ZDNE',
'ZDNP',
'ZDRR',
'ZDSE',
'ZDSP',
'ZDST',
'ZDSU',
'ZDVC',
'ZDVF',
'ZDVP',
'ZDXP',
'ZRAT' ).
Here is the full source code of my ABAP program: z-sd-indicador-devolucao.txt.
The program always works fine in development and quality environment, but never in production.
Thanks regards.
2021 Feb 11 2:16 PM
Seems that 699 refers to "cannot use duplicate dependency rule name".
Only thing I see double is the ' ' in the fieldlist, so you could try to add this:
' ' as shtyp_label,Or, remove the initial values altogether from the fieldlist and use INTO CORRESPONDING FIELDS, like this:
SELECT
vbak~vbeln,
vbak~erdat,
vbak~auart,
tvaut~bezei,
vbfa~vbeln AS vbeln_vbfa,
vttk~shtyp,
lips~matnr,
makt~maktx,
lips~lfimg,
lips~vrkme,
t178t~vtext,
mara~ntgew
INTO CORRESPONDING FIELDS OF TABLE @ti_vbak
FROM vbak
..But that doesn't really explain why it works in one system, but not in another. Have you checked if there are differences on table(type) level between PROD and the other systems?
And have you recently transported other reports? Did you encounter the same issue there? Maybe it is not the report that is the issue here..
I have a ABAP program in development environment, and it works fine in development and quality SAP environmnet, but when I transport it to production environment, I get the problem:
And when I try activate the program direct in production environment I get the error:
The two logs said about SQL syntax error, so I try several different strategies for my Open SQL select, such as 'IN', 'FOR ALL ENTRIES', 'LOOP AT', etc., all strategies work fine in development and production, but all get wrong with this same error during transport to production.
What must I do for my ABAP program get away from this error?
This is my Open SQL query:
SELECT
VBAK~VBELN,
VBAK~ERDAT,
VBAK~AUART,
TVAUT~BEZEI,
VBFA~VBELN,
VTTK~SHTYP,
' ',
LIPS~MATNR,
MAKT~MAKTX,
LIPS~LFIMG,
LIPS~VRKME,
T178T~VTEXT,
0,
' ',
MARA~NTGEW
INTO TABLE @TI_VBAK
FROM VBAK
INNER JOIN VBAP ON VBAP~VBELN = VBAK~VBELN
INNER JOIN VBFA ON VBFA~VBTYP_N = 'T' AND VBFA~VBELV = VBAK~VBELN
INNER JOIN LIPS ON LIPS~VBELN = VBFA~VBELN AND LIPS~POSNR = VBFA~POSNN AND LIPS~MATNR = VBAP~MATNR
LEFT JOIN VTTP ON VTTP~VBELN = LIPS~VBELN
LEFT JOIN VTTK ON VTTK~TKNUM = VTTP~TKNUM
LEFT JOIN TVAUT ON TVAUT~SPRAS = 'P' AND TVAUT~AUGRU = VBAK~AUGRU
LEFT JOIN MVKE ON MVKE~MATNR = LIPS~MATNR AND MVKE~VKORG = VBAK~VKORG AND MVKE~VTWEG = VBAK~VTWEG
LEFT JOIN T178T ON T178T~SPRAS = 'P' AND T178T~KONDM = MVKE~KONDM
LEFT JOIN MAKT ON MAKT~MATNR = LIPS~MATNR AND MAKT~SPRAS = 'P'
LEFT JOIN MARA ON MARA~MATNR = LIPS~MATNR
WHERE VBAK~ERDAT IN @S_DATE
AND VBAK~AUART IN ( 'ZDAA',
'ZDAE',
'ZDAP',
'ZDAT',
'ZDBE',
'ZDBP',
'ZDCE',
'ZDCJ',
'ZDCP',
'ZDCS',
'ZDEX',
'ZDFA',
'ZDFE',
'ZDFF',
'ZDFP',
'ZDFR',
'ZDFT',
'ZDFV',
'ZDLE',
'ZDLP',
'ZDME',
'ZDMP',
'ZDNE',
'ZDNP',
'ZDRR',
'ZDSE',
'ZDSP',
'ZDST',
'ZDSU',
'ZDVC',
'ZDVF',
'ZDVP',
'ZDXP',
'ZRAT' ).
Here is the full source code of my ABAP program: z-sd-indicador-devolucao.txt.
The program always works fine in development and quality environment, but never in production.
Thanks regards.
2021 Feb 11 2:07 PM
Hi,
Are all systems development, quality and production on the same component versions and the same kernel patches? (can be compared using system -> status -> other kernel information and system -> status -> product version -> details)
Best regards,
Geert-Jan Klaps
2021 Feb 12 6:17 AM
Yes, all systems are on the same component versions and patches.
2021 Feb 11 2:16 PM
Seems that 699 refers to "cannot use duplicate dependency rule name".
Only thing I see double is the ' ' in the fieldlist, so you could try to add this:
' ' as shtyp_label,Or, remove the initial values altogether from the fieldlist and use INTO CORRESPONDING FIELDS, like this:
SELECT
vbak~vbeln,
vbak~erdat,
vbak~auart,
tvaut~bezei,
vbfa~vbeln AS vbeln_vbfa,
vttk~shtyp,
lips~matnr,
makt~maktx,
lips~lfimg,
lips~vrkme,
t178t~vtext,
mara~ntgew
INTO CORRESPONDING FIELDS OF TABLE @ti_vbak
FROM vbak
..But that doesn't really explain why it works in one system, but not in another. Have you checked if there are differences on table(type) level between PROD and the other systems?
And have you recently transported other reports? Did you encounter the same issue there? Maybe it is not the report that is the issue here..
2021 Feb 12 6:23 AM
I tried the first option with column alias and I got the same error. So I tried the second option removing initial values from select and using corresponding fields on select, so the program works fine. But the fact of original query works on quality and it don't work on production is strange because the sap version on quality is same on production. But it doesn't matter, because removing the initial values all worked fine.
Thank you Patrick. God bless you.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |