‎2008 May 29 10:41 AM
hkont waers shkzg wrbtr
0001200120 | USD | H | 6688.96 |
0001000100 | USD | S | 6688.96 |
0001200105 | EUR | H | 6688.96 |
0001000250 | EUR | S | 100000.00 |
0007991110 | EUR | H | 100000.00 |
0001000100 | CAD | S | 100000.00 |
0007991300 | CAD | H | 100000.00 |
0001000250 | EUR | S | 20000.00 |
0007991110 | EUR | H | 20000.00 |
|0001000100|GBP |S | 20000.00
hi,
Have an requirement to add the wrbtr field based on the gl account number(HKONT)
Currency(WAERS) and debit/credit indicator(SHKZG).
If the accounts are same then currency needs to be checked and it the currency is also the same
then the indicator has to be checked and the wrbtr value has to be calulated... WRBTR = S - H.
Example: For a glaccount if there are 4 currencies with 3s and 1H then the final record will be a single
record with the gl account number, currency and debit indicator and WRBTR = SSS-H.
if the account and currency are not similar ...the values can be appended direclty...
..was trying to use field-symbols..please help on this ...how to do it.
‎2008 May 29 10:55 AM
Hello,
Do something like this (itab1 has your 4 fields, itab2 has 3 fields - doesn't have shkzg):
LOOP AT itab1 INTO wa_1.
CLEAR wa_2.
wa_2-hkont = wa_1-hkont.
wa_2-waers = wa_1-waers.
IF wa_1-shkzg EQ 'S'.
wa_2-wrbtr = wa_1-wrbtr.
ELSE.
wa_2-wrbtr = - wa_1-wrbtr.
ENDIF.
COLLECT wa_2 INTO itab2.
ENDLOOP.
Best regards.
Valter Oliveira.
‎2008 May 29 10:55 AM
Hello,
Do something like this (itab1 has your 4 fields, itab2 has 3 fields - doesn't have shkzg):
LOOP AT itab1 INTO wa_1.
CLEAR wa_2.
wa_2-hkont = wa_1-hkont.
wa_2-waers = wa_1-waers.
IF wa_1-shkzg EQ 'S'.
wa_2-wrbtr = wa_1-wrbtr.
ELSE.
wa_2-wrbtr = - wa_1-wrbtr.
ENDIF.
COLLECT wa_2 INTO itab2.
ENDLOOP.
Best regards.
Valter Oliveira.
‎2008 May 29 1:19 PM