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

HELP IN FM

Former Member
0 Likes
679

HI,

i doing job that insert data to table and i need to call the fm above when curr eq x and curr ex ' ' i need advice how to do it

efficient , i now that i can call the fm twice but maybe there is another way?

CALL FUNCTION 'Z_GET_PROJECT'

EXPORTING

project = gt_prps-psphi

date_from = l_datefrom

date_to = l_dateto

curr_usd = curr

IMPORTING

rev_center = center

project_name = project_name

i reward

Regards

HI,

i doing job that insert data to table and i need to call the fm above when curr eq x and curr ex ' ' i need advice how to do it

efficient , i now that i can call the fm twice but maybe there is another way?

CALL FUNCTION 'Z_GET_PROJECT'

EXPORTING

project = gt_prps-psphi

date_from = l_datefrom

date_to = l_dateto

curr_usd = curr

IMPORTING

rev_center = center

project_name = project_name

i reward

Regards

5 REPLIES 5
Read only

Former Member
0 Likes
660

hi, use thi fm

DATE_CREATE Calculates a date from the input parameters:

Example:

CALL FUNCTION 'DATE_CREATE'

EXPORTING

anzahl_jahre = 1

anzahl_monate = 2

anzahl_tage = 3

datum_ein = '20010101'

IMPORTING

datum_aus = l_new_date.

Result:

l_new_date = 20020304

regards,

satish.

Read only

0 Likes
660

i satih,

u don't understand my question ,i have the field curr in exporting and i wont to insert data into table when curr eq x

and cur is initial what is the best way to do that ,

i now that i can call the twice but maybe there is another way?

Regards

Read only

0 Likes
660

Hi ricardo,

> u don't understand my question ,i have the field curr in exporting and i wont to insert data into table when curr eq x

> and cur is initial what is the best way to do that ,

Sorry curr cant be eq x and initial at the same time - this is not AND but OR.

Why not use IF ( CUR = 'X' or CUR = space ).

Regards,

Clemens

Read only

Sougata
Active Contributor
0 Likes
660

Try this way, follow pseudo code below.

DATA curr TYPE c LENGTH 1.

IF cond1 is true.
 CLEAR curr.
ELSE.
  curr = 'X'.
ENDIF.

* Now call your function with the value above as per condition

CALL FUNCTION 'Z_GET_PROJECT'
   EXPORTING
     project = gt_prps-psphi
     date_from = l_datefrom
     date_to = l_dateto
    *curr_usd = curr*
   IMPORTING
     rev_center = center
     project_name = project_name.

Cheers,

Sougata.

Read only

Former Member
0 Likes
660

Hi Ricardo,

CURR filed should not be X ... u should enter some numerical values for the value of CURR.

Even then if you wanna do it then use IF condition before calling ur Function module... and check the value of CURR ...

IF ( CURR = 'X' or CURR = SPACE ).

CALL FUNCTION 'Z_GET_PROJECT'

EXPORTING

project = gt_prps-psphi

date_from = l_datefrom

date_to = l_dateto

curr_usd = curr

IMPORTING

rev_center = center

project_name = project_name

ENDIF.

Hope it will solve ur problem..

Reward points if useful..

Thanks & Regards

ilesh 24x7