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

please help me

laxman_sankhla3
Participant
0 Likes
1,182

hi

i want to send mail automatic to user when below condition is satified.

Data: ZUONR1 LIKE BSEG-ZUONR.

data: 2days_out type sy-datum.

2days_out = sy-datum + 2.

data: lv_date type sy-datum.

data: lv_formatdate(10) type c.

data: var1(4) type c,

var2(2) type c,

var3(2) type c.

lv_date = 2days_out.

var1 = lv_date+(4).

var2 = lv_date+4(2).

var3 = lv_date+6(2).

concatenate var3 var2 var1 into lv_formatdate separated by '.'.

<b>select single zuonr from bseg into zuonr1

where bukrs = 'GSEG' and ZUONR = lv_formatdate.</b>

<b>zuonr is not date field its character field .</b>

thanks.

1 ACCEPTED SOLUTION
Read only

former_member378318
Contributor
0 Likes
1,130

You do not need to reformat the date, it is already in the correct format. Change you code as follows:

Data: ZUONR1 LIKE BSEG-ZUONR.

data: 2days_out type sy-datum.

2days_out = sy-datum + 2.

data: lv_date type sy-datum.

lv_date = 2days_out.

select single zuonr from bseg into zuonr1

where bukrs = 'GSEG' and ZUONR = lv_date.

9 REPLIES 9
Read only

former_member378318
Contributor
0 Likes
1,131

You do not need to reformat the date, it is already in the correct format. Change you code as follows:

Data: ZUONR1 LIKE BSEG-ZUONR.

data: 2days_out type sy-datum.

2days_out = sy-datum + 2.

data: lv_date type sy-datum.

lv_date = 2days_out.

select single zuonr from bseg into zuonr1

where bukrs = 'GSEG' and ZUONR = lv_date.

Read only

former_member378318
Contributor
0 Likes
1,130

Oops ignore my last message, you are right ZUONR is char not date. Is the select not working or do you require details on how to send an email??

Read only

0 Likes
1,130

hi

select not working and also i require details on how to send an email?? .

please help .

thanks.

Read only

0 Likes
1,130

hi

i got data in select but now i want how to send mail to perticular user.

thanks.

Read only

0 Likes
1,130

Well I don't see any problems with the select statement and it should work so long as you have an entry in BSEG where bukrs = 'GSEG' and zuonr = DD.MM.YYYY

Have you checked an entry exists with the data you see in debug?

What makes you suspect the select is not working?

Read only

0 Likes
1,130

You can use methods of the class CLS_BCS to send an external email, see the following examples:

BCS_EXAMPLE_1

BCS_EXAMPLE_2

BCS_EXAMPLE_3

BCS_EXAMPLE_4

BCS_EXAMPLE_5

BCS_EXAMPLE_6

Read only

0 Likes
1,130

thanks man .

problem is solved.

Read only

Former Member
0 Likes
1,130

hi,

declare var1, var2, var3 as string variables n try

wit regards,

Suresh.A

Read only

Former Member
0 Likes
1,130

Hi,

correct it var1 = lv_date+0(4).

regards,

ruchika

Reward if useful.........