Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

need to join with_item and bkpf

Former Member
0 Kudos

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

22 REPLIES 22

Former Member
0 Kudos

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.

former_member192723
Active Participant
0 Kudos

Hi,

Can you explain more about requirement?

Shravan

Former Member
0 Kudos

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...

0 Kudos

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

Former Member
0 Kudos

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

0 Kudos

This message was moderated.

0 Kudos

Hello Sankil,

Its very difficult to understand above pasted code. Please import your code in notepad or word document for better understanding.

regards,

Deepti

0 Kudos

Hi Deepti,      I have used ur code but its not reflecting,its still showing negative sign.  Regards Sankil

0 Kudos

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

0 Kudos

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.

0 Kudos

Hi.

loop at it_lst where qbshb < 0.

it_lst-wt_qbshb =  it_lst-wt_qbshb * -1.

modify it_lst.

endloop.

Avirat

0 Kudos

Hi Avirat    its not working .

0 Kudos

Hi  I hv attached my code .

0 Kudos

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.

0 Kudos

Hi,

Is your code working as per your requirement or do you want any further help?

Shravan

0 Kudos

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

0 Kudos

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.

0 Kudos

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?.

0 Kudos

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

0 Kudos

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

0 Kudos

I have tried with this way but output is not occur as per required.

0 Kudos

Hi,

Debug your code from loop statement..pls...and analyse each statement carefully.

Shravan