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

smtp_addr

SHYEIKH
Explorer
0 Likes
3,541

Hi All,

I'm a novice on ABAP programming.Is there anybody to help me to fix my issue?

The following is the my code. I just want to get the email address from xk03. But didn't get SMTP_ADDR(email) though I got the NAME1(vendor name) by the following inner join. But why I couldn't get the email/SMTP_ADDR. If anybody know the solution then please help me.

Thanks

SELECT smtp_addr smtp_srch name1 adrc~addrnumber INTO TABLE t_adrc FROM adrc
  INNER JOIN adr6 ON adrc~addrnumber = adr6~addrnumber
WHERE adrc~name1 IN s_name1 AND
   adrc~addrnumber IN s_adrnr.

Hi All,

I'm a novice on ABAP programming.Is there anybody to help me to fix my issue?

The following is the my code. I just want to get the email address from xk03. But didn't get SMTP_ADDR(email) though I got the NAME1(vendor name) by the following inner join. But why I couldn't get the email/SMTP_ADDR. If anybody know the solution then please help me.

Thanks

SELECT smtp_addr smtp_srch name1 adrc~addrnumber INTO TABLE t_adrc FROM adrc
  INNER JOIN adr6 ON adrc~addrnumber = adr6~addrnumber
WHERE adrc~name1 IN s_name1 AND
   adrc~addrnumber IN s_adrnr.

4 REPLIES 4
Read only

Former Member
0 Likes
2,020

Hi,

Check at the table level if there is any value in SMTP_ADDR in ADR6.

Write the query as below.

SELECT adr6~smtp_addr adr6~smtp_srch adrc~addrnumber adrc~name1 INTO TABLE t_adrc FROM

adrc INNER JOIN adr6 ON adrc~addrnumber = adr6~addrnumber

WHERE adrc~name1 IN s_name1 AND

adrc~addrnumber IN s_adrnr.

Hope this helps.

Read only

RaymondGiuseppi
Active Contributor
0 Likes
2,020

Did you try to replace NAME1 with MC_NAME1 (uppercase)

Regards,

Raymond

Read only

JL23
Active Contributor
0 Likes
2,020

I wonder about the 2 fields in the where part of the selection.

The name is very unspecific, you could even have duplicates, the address number is unique in your SAP, but from where could you even know this number.

If you know this number already then specifying the name is not needed and even can lead to the fact that you don't find a record because of a mismatch in the entered name.

If you are working with international addresses then better use the address version (field NATION) to get a single hit.

Read only

SHYEIKH
Explorer
0 Likes
2,020

@Gaurav Dubey, @Raymond Giuseppi, @Jürgen L, thanks a lot to you all. In fact it was my fault, I made some errors in variable declaration. Now it fixed and working properly. Thanks again for your response.