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

Simple but Tricky Question .....

former_member181966
Active Contributor
0 Likes
734

HI All,

I have a question, I have 8 different dates field in upload file. we are using our own customize FM , which read the date from file and re-arrange it according to user profile setup in SU01.

My question is that what is the smartest way to pass these 8 fields all together and get 8 fields according to the user profile.

I don’t want to take 8 different variables and use this Fm 8 times for each date in upload file.

Remember as per 1 recorded file I can have dates up to 8 fields as I have 8 different fields in column which I want to upload .

If I’ll use

<b>perform convert_date_to_user_profle using Variable1 ( Coolum Date)

Variable2 ( Column Date)

Variable3 ( Column Date)

Variable4 ( Column Date)

Variable5 ( Column Date)

Variable6 ( Column Date)

Variable7 ( Column Date)

Variable8 ( Column Date)

changing All variables gain ...</b>

<b>You can send only for date input in one time and get the result...</b>

Pl gives your input/suggestions.

Thanks

HI All,

I have a question, I have 8 different dates field in upload file. we are using our own customize FM , which read the date from file and re-arrange it according to user profile setup in SU01.

My question is that what is the smartest way to pass these 8 fields all together and get 8 fields according to the user profile.

I don’t want to take 8 different variables and use this Fm 8 times for each date in upload file.

Remember as per 1 recorded file I can have dates up to 8 fields as I have 8 different fields in column which I want to upload .

If I’ll use

<b>perform convert_date_to_user_profle using Variable1 ( Coolum Date)

Variable2 ( Column Date)

Variable3 ( Column Date)

Variable4 ( Column Date)

Variable5 ( Column Date)

Variable6 ( Column Date)

Variable7 ( Column Date)

Variable8 ( Column Date)

changing All variables gain ...</b>

<b>You can send only for date input in one time and get the result...</b>

Pl gives your input/suggestions.

Thanks

6 REPLIES 6
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
685

What's wrong with sending the dates thru to the FORM as you have done above. You can send it like that or you can send the entire row to the FORM via changing.

Regards,

Rich Heilman

Read only

0 Likes
685

Here is what I mean about passing the entire row.




report zrich_0003.

data: begin of itab occurs 0,
      field1(10) type c,
      field2(10) type c,
      field3(10) type c,
      end of itab.


loop at itab.

  perform convert_date_to_user_profile changing itab.

endloop.

*&---------------------------------------------------------------------*
*&      Form  convert_date_to_user_profile
*&---------------------------------------------------------------------*
form convert_date_to_user_profile changing wa like itab.

* convert field 1
  write:/ wa-field1.

* convert field 2
  write:/ wa-field2.

* convert field 3
  write:/ wa-field3.

endform.

Regards,

Rich Heilman

Read only

0 Likes
685

I have to pass each variable every time to FM and get the result and pass back ..I am looking for a shortcut, I don’t want to code it again and again .. I think this the only way I can do it . I have to code like this pass these variables to Fm one by one and get date one by one and pass to BDC program.

Thanks Rich..

Read only

0 Likes
685

Well, in my example above, we are passing the entire line, and you only need to call the routine once, convert all the dates in one call, and pass back the entire converted row. This is what I'm trying to illistrate above. Does that make sense to you?

Regards,

Rich Heilman

Read only

0 Likes
685

Definitely Rich . It makes sense to me . I am just looking any other option in which I don’t have to declare an itab or so many variables. Looks like this the only option so far ..

Thanks for your prompt reply !!!

Read only

0 Likes
685

report zrich_0003.
 
TYPES: BEGIN OF ITAB,
       FIELD1(10) TYPE C,
       FIELD2(10) TYPE C,
       FIELD3(10) TYPE C,
       END OF ITAB.

DATA: MY_TAB TYPE STANDARD TABLE OF ITAB WITH HEADER LINE.

PERFORM CONVERT_DATE_TO_USER_PROFILE TABLES MY_TAB.

*&---------------------------------------------------------------------*
*&      Form  convert_date_to_user_profile
*&---------------------------------------------------------------------*
FORM CONVERT_DATE_TO_USER_PROFILE TABLES MY_TAB STRUCTURE MY_TAB.

* convert field 1
  WRITE:/ MY_TAB-FIELD1.

* convert field 2
  WRITE:/ MY_TAB-FIELD2.

* convert field 3
  WRITE:/ MY_TAB-FIELD3.

ENDFORM.                    "convert_date_to_user_profile

Sorry for steal your code Rich -:P But i think that this is a better way to do it -;)

Greetings,

Blag.