Application Development and Automation 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: 
Read only

Logic needed on general abap

Former Member
0 Likes
347

Hi Experts

I am having a list of TAXCODES like.

"CA" "CC" "CD" "DA" "DE" "WS"

Now in purchase orders if i am having different line items having the above TAX CODES.

i need to pass a variable &XXX& which is having text to sap script form.

And if the Purchase order having line items which is having one of the taxcode above for one line item and the other line item having diifferent taxcode like V0 etc { for these case i dont need to send text data }

and if the PO having one tax code for all line items.{ i need to send the data }

how to achive this

i am trying in this way

SELECT ebeln

ebelp

mwskz "Tax code

FROM ekpo

INTO TABLE lt_ekpo

WHERE ebeln = v_ebeln

  • AND mwskz in r_mwskz

AND loekz = ''.

DESCRIBE TABLE lt_ekpo LINES lv_count.

lt_ekpo1[] = lt_ekpo[].

SORT lt_ekpo1 BY ebelp DESCENDING.

READ TABLE lt_ekpo1 INTO wa_ekpo INDEX 1.

v_ebelp1 = wa_ekpo-ebelp.

CLEAR wa_ekpo.

LOOP AT lt_ekpo INTO wa_ekpo.

IF sy-tabix = 1.

lv_taxcode = wa_ekpo-mwskz.

ELSE.

IF lv_taxcode NE wa_ekpo-mwskz.

lv_diff_tax = 'X'.

  • if lv_taxcode EQ 'CA' or lv_taxcode EQ 'CC' or lv_taxcode EQ 'CD' OR lv_taxcode EQ 'DA' OR lv_taxcode EQ 'DE' or lv_taxcode EQ 'WS'.

  • ELSE.

ENDIF.

ENDIF.

please provide the logic for the above case.

Edited by: suribabu124 on Apr 26, 2010 4:13 PM

Hi Experts

I am having a list of TAXCODES like.

"CA" "CC" "CD" "DA" "DE" "WS"

Now in purchase orders if i am having different line items having the above TAX CODES.

i need to pass a variable &XXX& which is having text to sap script form.

And if the Purchase order having line items which is having one of the taxcode above for one line item and the other line item having diifferent taxcode like V0 etc { for these case i dont need to send text data }

and if the PO having one tax code for all line items.{ i need to send the data }

how to achive this

i am trying in this way

SELECT ebeln

ebelp

mwskz "Tax code

FROM ekpo

INTO TABLE lt_ekpo

WHERE ebeln = v_ebeln

  • AND mwskz in r_mwskz

AND loekz = ''.

DESCRIBE TABLE lt_ekpo LINES lv_count.

lt_ekpo1[] = lt_ekpo[].

SORT lt_ekpo1 BY ebelp DESCENDING.

READ TABLE lt_ekpo1 INTO wa_ekpo INDEX 1.

v_ebelp1 = wa_ekpo-ebelp.

CLEAR wa_ekpo.

LOOP AT lt_ekpo INTO wa_ekpo.

IF sy-tabix = 1.

lv_taxcode = wa_ekpo-mwskz.

ELSE.

IF lv_taxcode NE wa_ekpo-mwskz.

lv_diff_tax = 'X'.

  • if lv_taxcode EQ 'CA' or lv_taxcode EQ 'CC' or lv_taxcode EQ 'CD' OR lv_taxcode EQ 'DA' OR lv_taxcode EQ 'DE' or lv_taxcode EQ 'WS'.

  • ELSE.

ENDIF.

ENDIF.

please provide the logic for the above case.

Edited by: suribabu124 on Apr 26, 2010 4:13 PM

1 REPLY 1
Read only

Former Member
0 Likes
313

hi

this can be done using rages

Regards

Suresh