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: 

can we join a table structure and a transparent table?

Former Member
0 Kudos

Pls let me know, whether we can join a table structure and a transparent table and how?

1 ACCEPTED SOLUTION

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

A table structure is just a "skeleton" of the data. It contains no data, just how the data is formatted in the table. You can not "join" a structure with a transparent table.

Regards,

Rich Heilman

7 REPLIES 7

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

A table structure is just a "skeleton" of the data. It contains no data, just how the data is formatted in the table. You can not "join" a structure with a transparent table.

Regards,

Rich Heilman

0 Kudos

Hi rich,

Since i dont have ur id ,iam posting my issue on this ,can u please help me on the below issue.

below i have a set of code which would sends email along with attachtment .

iam getting the XLS attachtment perfectly ,but for TXT attachtment there was problem with formating all the records are formated in single line .

a solution on this would be helpfull.

Thanks,

vinay .

FUNCTION Z_SHANKAR_ATTACHMENT.

*"----


""Local Interface:

*" IMPORTING

*" VALUE(EMAILID)

*" VALUE(SUBJECT)

*" VALUE(ATYPE)

*" TABLES

*" ATTACH_FILE STRUCTURE SOLISTI1

*" BODY OPTIONAL

*"----


  • This table requires information about how the data in the

  • tables OBJECT_HEADER, CONTENTS_BIN and CONTENTS_TXT are

  • to be distributed to the documents and its attachments.

DATA OBJPACK LIKE SOPCKLSTI1 OCCURS 2 WITH HEADER LINE.

  • This table must contain the summarized data dependent on each object type.

  • SAPscript objects store information here about forms and styles,

  • for example. Excel list viewer objects store the number of rows and columns

  • amongst other things and PC objects store their original file name.

DATA OBJHEAD LIKE SOLISTI1 OCCURS 1 WITH HEADER LINE.

  • This table must contain the summarized content of the objects identified as binary objects.

DATA OBJBIN TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0

WITH HEADER LINE.

  • This table must contain the summarized content of the objects identified as ASCII objects.

DATA OBJTXT LIKE SOLISTI1 OCCURS 10 WITH HEADER LINE.

  • This table must contain the document recipients.

DATA RECLIST LIKE SOMLRECI1 OCCURS 5 WITH HEADER LINE .

  • This structure must contain the attributes of the document to be sent.

DATA: DOC_CHING LIKE SODOCCHGI1.

DATA: TAB_LINES LIKE SY-TABIX.

  • Create the internal table for body , subject

DATA: IT_BODY LIKE SOLISTI1 OCCURS 10 WITH HEADER LINE.

*changes added to the code by shankar.

constants: x(1) type X value '0A'.

*End of changes to the code

CONSTANTS: con_cret TYPE C VALUE cl_abap_char_utilities=>horizontal_tab,

con_tab TYPE C VALUE cl_abap_char_utilities=>cr_lf,

con_new type c value CL_ABAP_CHAR_UTILITIES=>NEWLINE.

  • Move Body to Internal Table (body into it_body)

LOOP AT BODY .

MOVE BODY TO IT_BODY .

APPEND IT_BODY .

ENDLOOP.

DOC_CHING-OBJ_DESCR = SUBJECT. "Subject of the Email

  • Move the Subject and Body to OBJTXT

OBJTXT[] = IT_BODY[].

DESCRIBE TABLE OBJTXT LINES TAB_LINES.

READ TABLE OBJTXT INDEX TAB_LINES.

DOC_CHING-DOC_SIZE = ( TAB_LINES - 1 ) * 255 + STRLEN( OBJTXT ).

CLEAR OBJPACK-TRANSF_BIN.

OBJPACK-HEAD_START = 1.

OBJPACK-HEAD_NUM = 0.

OBJPACK-BODY_START = 1.

OBJPACK-BODY_NUM = TAB_LINES.

OBJPACK-DOC_TYPE = 'RAW'.

APPEND OBJPACK.

  • Convert IT to Excel format

IF ATYPE = 'XLS' .

LOOP AT ATTACH_FILE .

REPLACE ALL OCCURRENCES OF '#' IN ATTACH_FILE WITH con_cret. " INTO objbin.

CONCATENATE ATTACH_FILE con_tab INTO objbin.

APPEND objbin.

ENDLOOP.

ELSEIF ATYPE = 'TXT' .

LOOP AT ATTACH_FILE .

REPLACE ALL OCCURRENCES OF '#' IN ATTACH_FILE WITH con_tab. " INTO objbin.

CONCATENATE con_new ATTACH_FILE-line INTO OBJBIN-line .

*changes done by shankar

*CONCATENATE ATTACH_FILE-line con_new INTO OBJBIN-line .

APPEND OBJBIN .

ENDLOOP.

ENDIF.

****End-Code Excel Format .

DESCRIBE TABLE objbin LINES tab_lines.

objhead = subject. APPEND objhead.

  • Creating the entry for the compressed attachment

*

objpack-transf_bin = 'X'.

objpack-head_start = 1.

objpack-head_num = 1.

objpack-body_start = 1.

objpack-body_num = TAB_LINES.

objpack-doc_type = ATYPE.

objpack-obj_name = 'ATTACHMENT'.

objpack-obj_descr = 'TEST'. "Attachment File Name

objpack-doc_size = TAB_LINES * 255.

APPEND objpack..

reclist-receiver = EMAILID.

reclist-rec_type = 'U'.

APPEND reclist.

CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'

EXPORTING

DOCUMENT_DATA = DOC_CHING

PUT_IN_OUTBOX = 'X'

COMMIT_WORK = 'X'

  • IMPORTING

  • SENT_TO_ALL =

  • NEW_OBJECT_ID =

TABLES

PACKING_LIST = OBJPACK

OBJECT_HEADER = OBJHEAD

CONTENTS_BIN = OBJBIN

CONTENTS_TXT = OBJTXT

RECEIVERS = RECLIST

EXCEPTIONS

TOO_MANY_RECEIVERS = 1

DOCUMENT_NOT_SENT = 2

OPERATION_NO_AUTHORIZATION = 4

OTHERS = 99 .

ENDFUNCTION.

Former Member
0 Kudos

structure consists no data.

so we can not use join on that

0 Kudos

structure does not hodl any data so join will not work on structures <b>There by joining the structure and transparent table is not Possible.</b>

Regards,

Santosh

former_member181962
Active Contributor
0 Kudos

NO way.

Structures donot have any data. They are just templates to define how data should be.

Regards,

ravi

abdul_hakim
Active Contributor
0 Kudos

hi

<b>u cannot join structure and table.</b>

<b>you can only join tables</b>.......

Cheers,

Abdul Hakim

Mark all useful answers...

Former Member
0 Kudos

Hi,

We can't join structure and transaprent table

but we can append this structure to table

using append structure option in se11.

Regards,

Amole