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: 

Add new two columns dynamically based on Currency

anand_b3
Explorer
0 Kudos


Hi,

my requirement is in script form , if foreign currency is used in input i want add two new columns in layout with local currency Per Unti Price and Total Amount of local currency script is related Tax Invoice , Debit and Credit Note.

if local currency is used then only three columns are appeared those are Quantity , PerUnitPrice and Total Amount

Please help me.

8 REPLIES 8

Former Member
0 Kudos

Hi

You need to create 2 different text element: one for local currency and one for foreign currency


Mac

anand_b3
Explorer
0 Kudos

Hi Max,

Thanks to replay,

step1: i have one window like Header to display Heading details those are Description and Price.

now i want display Headings based on condition

IF BKPF-WAERS NE 'MYR'.

Description   Quantity   Per Unit Price(USD) Per Unit Price(RM)   Total(USD) Total/Price(RM)

ELSE

Description   Quantity   Per Unit Price Total/Price

step2 :

on same currency condition i want dispaly values under whcih is i given above headings

present Description  Total/Price are printing.

If foreign currency is used then i want display Local currency Total and Per Unit Price.

Per Unit Price = Quantity/Amount

Total(RM) = USD Total  * Exchange Rate

Exchange Rate printing some where else .

My question is can i print values based on currency condition in MAIN Window.

If possible give me some sample examples

Reward for all helpfull answers

Former Member
0 Kudos

Hi

You can use the fm WRITE_FORM in order to trigger a certain text element of the MAIN:


/E LOCAL_HEADER

*   Description   Quantity   Per Unit Price(USD) Per Unit Price(RM)   Total(USD) Total/Price(RM)

/E FOREIGN_HEADER

*   Description   Quantity   Per Unit Price Total/Pric

So in your program you should insert the following check:


IF BKPF-WAERS = T001-WAERS.

   CALL FUNCTION 'WRITE_FORM'

     EXPORTING

       ELEMENT  = 'LOCAL_HEADER'

       FUNCTION = 'SET'

       TYPE     = 'BODY'

       WINDOW   = 'MAIN'.

ELSE.

   CALL FUNCTION 'WRITE_FORM'

     EXPORTING

       ELEMENT  = 'FOREIGN_HEADER'

       FUNCTION = 'SET'

       TYPE     = 'BODY'

       WINDOW   = 'MAIN'

ENDIF.

Or you can insert the control in your form:


/E HEADER

/:  IF &BKPF-WAERS& = &T001-WAERS&

*   Description   Quantity   Per Unit Price(USD) Per Unit Price(RM)   Total(USD) Total/Price(RM)

/: ELSE

*   Description   Quantity   Per Unit Price Total/Pric

/: ENDIF

0 Kudos

Hi Max,

Thank you so much for your replay.

0 Kudos

Hi Max,

Your replay very useful to me.

Thanks for this,

Let me know one thing , i am getting values in different Text Elements, but i want display in same line ,

Ex:

Description                   Quantity                PerUnitPrice

  Test Data                    100 PC                       10000

Ex Code:

/:500

&gv_tdline_new&

/: 501

&bseg-menge&

/:502

&wa_itab-uprice&

Here i want display in same line of above printed lines , is is possible.

If possible please give sample example

0 Kudos

Hi Anand,

You can display all texts in 1 line.

&gv_tdline_new&,,&bseg-menge&,,&wa_itab-uprice&


Here, ',,' stands for tab. So, it will display your data as below:


Test Data                    100 PC                       10000

Former Member
0 Kudos

Hi

you should create a text element for local currency and one for foreign currency:


Ex:

Description                   Quantity                PerUnitPrice

  Test Data                    100 PC                       10000

Ex Code:

/:500

&gv_tdline_new&

/: 501

&bseg-menge&

/:502

&wa_itab-uprice&

so you should have:

/:500 &gv_tdline_new& &bseg-menge& &wa_itab-uprice&

Max

anand_b3
Explorer
0 Kudos

Thanks you very much for your response