Error With Datasource Enhancement
Error With Datasource Enhancement
1 of 13
https://archive.sap.com/discussions/thread/3940859
(http://go.sap.com/index.html)
(https://onedx.find.sap.com)
(htt
ps:/
/sh
are
dui.
ser
vice
s.sa
p.c
om
/pro
tect
ed.
htm
l?re
f=ht
tps:
//ar
chiv
e.s
ap.
co
m/)
(https://www.facebook.com/sapcommunitynetwork?ref=ts)
(https://www.youtube.com/user/SAPCommunities)
(https://plus.google.com/u/0/+SAPCommunities/posts)
(https://twitter.com/sapcommnet)
(https://www.linkedin.com/company/sap)
(https://instagram.com/sap/)
(http://www.slideshare.net/SAP)
Privacy (http://go.sap.com/about/legal/privacy.html)
Terms of Use (http://go.sap.com/corporate/en/legal/terms-of-use.html)
Legal Disclosure (http://go.sap.com/about/legal/impressum.html)
Copyright (http://go.sap.com/about/legal/copyright.html)
Trademark (http://go.sap.com/about/legal/trademark.html)
Sitemap (http://www.sap.com/sitemap/index.html)
Newsletter
(https://go.sap.com/registration/newsletter.html)
10/26/2016 11:54 PM
2 of 13
https://archive.sap.com/discussions/thread/3940859
/
(/discussions) /
Archives (/) /
Discussions Archive
Hi everyone,
i enhancing generic datasource D_VBSEGK by calculating net due date using FM:
"DETERMIN_DUE_DATE". Here is my Code:
DATA: l_s_ZOXERS0119 LIKE ZOXERS0119,
lwa_faede type faede.
CASE i_datasource.
WHEN 'D_VBSEGK'.
LOOP AT i_t_data INTO l_s_ZOXERS0119.
l_tabix = sy-tabix.
lwa_faede-koart = 'K' or 'D'. "Acct type
lwa_faede-ZFBDT = SOURCE_FIELDS-ZFBDT.
lwa_faede-SHKZG = 'H' or 'S' ."Credit or Debit
lwa_faede-ZBD3T = SOURCE_FIELDS-ZTERM.
CALL FUNCTION 'DETERMINE_DUE_DATE'
EXPORTING
i_faede = lwa_faede
IMPORTING
e_faede = lwa_faede
EXCEPTIONS
OTHERS = 1.
l_s_ZOXERS0119-ZZFAEDT = lwa_faede-netdt.
MODIFY i_t_data FROM l_s_ZOXERS0119 INDEX l_tabix.
ENDLOOP.
ENDCASE
10/26/2016 11:54 PM
3 of 13
https://archive.sap.com/discussions/thread/3940859
The field "I_T_DATA" ist unknown, but there is a field with the similar
name "C_T_DATA". "C_T_DATA".
i am really new with ABAP, to write this Code, i have read alots on SCn and ABAP Forum. But its still not
correct
(https://people.sap.com/chrom.men)
Pha London (https://people.sap.com/chrom.men)
August 04, 2016 at 14:13 PM
0 Likes
Helpful Answer by
D. Chia (/discussions/message/16878671#16878671) , D. Chia (/discussions/message/16878910#16878910)
(https://people.sap.com/newb)
10/26/2016 11:54 PM
4 of 13
https://archive.sap.com/discussions/thread/3940859
(https://people.sap.com/chrom.men)
Pha London (https://people.sap.com/chrom.men)replied
10/26/2016 11:54 PM
5 of 13
https://archive.sap.com/discussions/thread/3940859
i think i did something wrong from " lwa_faede-koart = 'K' . "Acct type" to
the End
(https://people.sap.com/newb)
NewB To Abap (https://people.sap.com/newb)replied
August 04, 2016 at 15:10 PM
TYPES:BEGIN OF st_faede,
l_s_zoxers0119 LIKE mara-matnr,
lwa_faede TYPE faedt_fpos,
l_tabix TYPE sy-tabix.
TYPES:END OF st_faede.
DATA: lwa_faede TYPE st_faede.
*"lwa_faede-koart = 'K' . "Acct type
*lwa_faede-zfbdt = ."'H' ."Credit or Debit
*lwa_faede-zbd3t = ."l_s_zoxers0119zterm..
lwa_faede-l_s_zoxers0119 = ''.
CALL FUNCTION
'DETERMINE_DUE_DATE'
EXPORTING
i_faede
= lwa_faede
* I_GL_FAEDE
* IMPORTING
* E_FAEDE
EXCEPTIONS
10/26/2016 11:54 PM
6 of 13
https://archive.sap.com/discussions/thread/3940859
ACCOUNT_TYPE_NOT_SUPPORTED
OTHERS
=1
=2
.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
1) your are passing koart into the structure lwa_fade , But where is
the field koart first declare the
feild in the above.
lwa_faede-koart = 'K' . "Acct type
D. Chia (https://people.sap.com/duncan.scn)replied
(https://people.sap.com/duncan.scn)
i am assuming you
are coding this in the
customer exit FM for
enhancement
RSAP0001?
as per the syntax
error msg ... the
internal table
10/26/2016 11:54 PM
7 of 13
https://archive.sap.com/discussions/thread/3940859
(https://people.sap.com/chrom.men)
Pha London (https://people.sap.com/chrom.men)replied
Hi Chia,
You are correct. i'm using the FM for Enhancement RSAP0001. im not
famaliar with the FM module, so i try to test it with ZX Include. Unfornately
it doesn't work.
i have replaced I_T_DATA with C_T_DATA and select only one value for
lwa_faede-koart.
10/26/2016 11:54 PM
8 of 13
https://archive.sap.com/discussions/thread/3940859
i_faede = lwa_faede
IMPORTING
e_faede = lwa_faede
EXCEPTIONS
OTHERS = 1.
l_s_ZOXERS0119-ZZFAEDT = lwa_faede-netdt.
MODIFY c_t_data FROM l_s_ZOXERS0119 INDEX l_tabix.
ENDLOOP.
ENDCASE.
But there still Error: the data object ""LWA_FAEDE" has no structure
and therefore no component called "KOART".
Helpful Answer
(https://people.sap.com/duncan.scn)
D. Chia (https://people.sap.com/duncan.scn)replied
August 04, 2016 at 15:21 PM
10/26/2016 11:54 PM
9 of 13
https://archive.sap.com/discussions/thread/3940859
tcode SE37 and look at the import paramater 'i_faede' TYPE ....
0
(https://people.sap.com/chrom.men)
Pha London (https://people.sap.com/chrom.men)replied
August 04, 2016 at 15:45 PM
Thanks Chia,
i modify my Code, and it works. but i
don't know why it still working when i
haven't added:
lwa_faede-bldat. =
l_s_ZOXERS0119bldat."Document Date in
Document
Here is my Code:
DATA: l_s_ZOXERS0119 LIKE
ZOXERS0119,
lwa_faede type FAEDE,
l_tabix type sy-tabix.
CASE i_datasource.
WHEN 'D_VBSEGK'.
LOOP AT c_t_data INTO
l_s_ZOXERS0119.
l_tabix = sy-tabix.
10/26/2016 11:54 PM
10 of 13
https://archive.sap.com/discussions/thread/3940859
l_s_ZOXERS0119-rebzt.
lwa_faede-rebzg = l_s_ZOXERS0119-rebzg.
CALL FUNCTION 'DETERMINE_DUE_DATE'
EXPORTING
i_faede = lwa_faede
IMPORTING
e_faede = lwa_faede
EXCEPTIONS
ACCOUNT_TYPE_NOT_SUPPORTED
OTHERS
=1
= 2.
IF sy-subrc = 0.
l_s_ZOXERS0119-ZZFAEDT = lwa_faede-netdt.
MODIFY c_t_data FROM l_s_ZOXERS0119 INDEX
l_tabix.
ENDIF.
ENDLOOP.
ENDCASE.
0
(https://people.sap.com/duncan.scn)
D. Chia (https://people.sap.com/duncan.scn)replied
August 04, 2016 at 16:05 PM
10/26/2016 11:54 PM
11 of 13
https://archive.sap.com/discussions/thread/3940859
(https://people.sap.com/chrom.men)
Pha London (https://people.sap.com/chrom.men)replied
August 04, 2016 at 16:05 PM
Hi Chia,
i check the datasource in
RSA3 and it returns value. it
looks good but i need check it
again.
Hier is the Explaination:
lwa_faede-ZFBDT =
l_s_ZOXERS0119-ZFBDT.
"Baseline Date for Due Date
Calculation
lwa_faede-ZBD1T =
l_s_ZOXERS0119ZBD1T."Cash Discount Days
1
lwa_faede-ZBD2T =
l_s_ZOXERS0119-ZBD2T.
"Cash Discount Days 2
lwa_faede-rebzt =
10/26/2016 11:54 PM
12 of 13
https://archive.sap.com/discussions/thread/3940859
i have a question:
the fields: SHKZG in datasource has 2 value: 'H' and
'S' and koart has : 'K' and 'D' . i just include one value
of each paar to test the Code.
But when the field has 2 value, i need to include them
into the Code rights?
How to do that?
i have tried but it doesn't work with "OR"
0
Helpful Answer
(https://people.sap.com/duncan.scn)
D. Chia (https://people.sap.com/duncan.scn)replied
August 04, 2016 at 16:28 PM
10/26/2016 11:54 PM
13 of 13
https://archive.sap.com/discussions/thread/3940859
(https://people.sap.com/chrom.men)
Pha London (https://people.sap.com/chrom.men)replied
August 04, 2016 at 16:41 PM
Thanks Chia.
You are so nice and ..
beautiful also
1
10/26/2016 11:54 PM