12-24-2012 1:46 PM
Hi All,
I have made one report related with TDS. Here I am getting one new requirement from user side. They want reversal document's w/h amount(wt_qbshh) should be with positive sign,right now its showing in negative sign of every document(belnr).Here I have taken with_item table for w/h amount(wt_qbshh) and I got the reversal doc document in bkpf.Even I have to change the sign of only reversed document amount(wt_qbshh).
Please help me out how to go.Shall i use join query between bkpf and with_item.
In BKPF field is STBLG and
In With_Item field is WT_QBSHH
Thanks and Regards
Sankil pandya
12-24-2012 4:54 PM
If you want to convert a negative number into positive number, you can just use abs( num) function.
I could not understand your entire query, but I think you want to convert a negative number to positive number.
Please give some abstract instead of details.
12-24-2012 5:55 PM
12-25-2012 2:23 AM
Hi
In table BESG the amount is positive, I'm not clearly about your issue,
I think you should explain it more in detail, we can't understand it well...
12-26-2012 6:40 AM
In My Report there is fields for document and its reverse document and their corresponding w/h amount.
but here w/h amount showing negative sign. so i have to do this sign into positive and only for corresponding reverse document .
Regards
Sankil
12-26-2012 8:36 AM
Hello Sankil,
Yes you can use join or extract all values from BSEG first then using for all entries, extract data from wt_item. And put below condition for checking your amount to be postive or negative.
You need to loop the entries of wt_item and check BSEG entires with the help of read statement then apply below logic.
IF w_bseg-shkzg = 'S'.
IF with_item_tab-wt_qbshb < 0.
with_item_tab-wt_qbshb = with_item_tab-wt_qbshb * -1.
ENDIF.
ELSE.
IF with_item_tab-wt_qbshb > 0.
with_item_tab-wt_qbshb = with_item_tab-wt_qbshb * -1.
ENDIF.
ENDIF.
regards,
Deepti
12-26-2012 9:05 AM
12-26-2012 9:10 AM
Hello Sankil,
Its very difficult to understand above pasted code. Please import your code in notepad or word document for better understanding.
regards,
Deepti
12-26-2012 9:14 AM
Hi Deepti, I have used ur code but its not reflecting,its still showing negative sign. Regards Sankil
12-26-2012 9:31 AM
Hi deepti Plz let me know ur email so i can send u code coz here in discussion its not taking in word and notepad. Regards Sankil
12-26-2012 9:43 AM
Hi Sankil,
Please use code snippets, this will enable others to clearly understand your code. Alternatively you can paste your code in notepad or wordpad and attach it to your message.
Regards,
Makaza.
12-26-2012 9:46 AM
Hi.
loop at it_lst where qbshb < 0.
it_lst-wt_qbshb = it_lst-wt_qbshb * -1.
modify it_lst.
endloop.
Avirat
12-26-2012 10:08 AM
12-26-2012 10:27 AM
12-26-2012 12:08 PM
Hi All, W/H tax amount value has come into positive but all reversal doc amount value showing in positive also,but I want only those which original doc start with 18 and its corresponding reverse doc start with 20. I have written code like this LOOP AT it_lst where wt_qbshh < 0. if it_lst-KOART = 'K'. *if it_lst-augbl+0(2) = 18. if it_lst-belnr+0(2) = 20. it_lst-wt_qbshh = -1 * it_lst-wt_qbshh. MODIFY table it_lst. "from it_lst transporting wt_qbshh. ENDIF. ENDIF. * ENDIF. ENDLOOP.
12-26-2012 2:40 PM
Hi,
Is your code working as per your requirement or do you want any further help?
Shravan
12-27-2012 4:55 AM
Hi Kumar, No its not working as per requirement, actually I want only those reverse documents w/h tax amount value should be positive whose original documents start with 18 and its reverse start with 20. **There are other documents also whose whose reverse doc start with 20.but I want only those doc whose original start with 18 and reverse with 20. Regards Sankil
12-27-2012 9:26 AM
Hi All, This is the code I have written but not works properly.please suggest me if modifications required. LOOP AT it_lst where wt_qbshh < 0. if it_lst-belnr+0(2) = 18 and if it_lst-belnr+0(2) = 20. it_lst-wt_qbshh = -1 * it_lst-wt_qbshh. ELSE. if it_lst-belnr+0(2) = 20. it_lst-wt_qbshh = 1 * it_lst-wt_qbshh. ENDIF. ENDIF. MODIFY table it_lst. "from it_lst transporting wt_qbshh. ENDIF. ENDIF. ENDIF. ENDLOOP.
12-27-2012 9:38 AM
hi,
if it_lst-belnr+0(2) = 18 or if it_lst-belnr+0(2) = 20.
and why are you using if it_lst-belnr+0(2) = 20.in two places?.
12-27-2012 10:16 AM
In first i was trying with augbl it_lst_augbl+0(2)= 18. and another it_lst_belnr+0(2)= 20.but its not reflecting Regards Sankil
12-27-2012 10:25 AM
hi,
see create two local variables for it_lst_augbi+0(2) and same with it_lst_belnr+0(2) and try.
Please put a debugger there and check.
hope it helps,
Vinoth
12-27-2012 10:42 AM
I have tried with this way but output is not occur as per required.
12-27-2012 1:27 PM
Hi,
Debug your code from loop statement..pls...and analyse each statement carefully.
Shravan