on 04-07-2010 9:47 AM
HI,
What i want to achieve here is to get the original payment method for a clearing document type by coding them in a program.
For example:-
I have an invoice 1100923421 that has the document type RV and what I need to see it to tells me is that the RV (Invoice) has been cleared by a Bacs Payment (ZB) / Cheque Payment (ZQ).
I created a table type rfposxext and has all the value collected into that table. But with all that information, how can i achieve what I want?
Any feedback / advise are highly appreciated.
Thanks,
Loo
Hey Loo,
I hope I'm understanding your question. Have you tried looking at table BSAD? That would give you the RV number (doc type) and if it has been cleared, that number would be stored in this table. Once you have that clearing number, you can get its doc type by using table BSID.
Cindy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Cindy,
Thanks Cindy. Unfortunately, when i checked the table BSID for the particular document that has been cleared, there's no result stored in table BSID.
Hi everyone,
I'm closing this thread as it seems that there's no direct way of getting the original document type for RV.
Thanks.
Cheers,
loo
Hi Guys,
Thank you for the reply and I managed to resolve them myself as i found out that there's no direct way to get the original document type for each RV. What i did was to loop at table BSAD for each RV, and get the document type for the clearing document and putting that document type as the original clearing document.
The following is the piece of code that I've done and i hope it will help others as well.
...
TYPES: BEGIN OF ty_zzaugblart,
belnr TYPE belnr_d,
blart TYPE blart,
END OF ty_zzaugblart.
DATA: ls_zzaugblart TYPE ty_zzaugblart.
DATA: lt_zzaugblart TYPE STANDARD TABLE OF ty_zzaugblart.
IF wa_pos-augbl IS NOT INITIAL.
SELECT SINGLE blart FROM bkpf INTO wa_pos-zzaugblart
WHERE bukrs EQ wa_pos-bukrs
AND belnr EQ wa_pos-augbl
AND gjahr EQ wa_pos-auggj.
IF wa_pos-zzaugblart = 'AB'.
REFRESH : lt_zzaugblart.
SELECT belnr blart FROM bsad INTO TABLE lt_zzaugblart
WHERE kunnr EQ wa_pos-konto
AND bukrs EQ wa_pos-bukrs
AND augdt EQ wa_pos-augdt
AND augbl EQ wa_pos-augbl
AND auggj EQ wa_pos-auggj.
IF lt_zzaugblart[] IS NOT INITIAL.
SORT lt_zzaugblart.
DELETE lt_zzaugblart WHERE blart = 'RV'
OR blart = 'RC'
OR blart = 'AB'.
IF lt_zzaugblart[] IS NOT INITIAL.
READ TABLE lt_zzaugblart INTO ls_zzaugblart
WITH KEY belnr = wa_pos-belnr.
IF sy-subrc = 0.
wa_pos-zzaugblart = ls_zzaugblart-blart.
ELSE.
CLEAR : ls_zzaugblart.
READ TABLE lt_zzaugblart INTO ls_zzaugblart INDEX 1.
wa_pos-zzaugblart = ls_zzaugblart-blart.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
...
Cheers,
Loo
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.