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: 

Relation between kunnr and attachments(Sap Office).

Former Member
0 Kudos

When we go to xd03 for a particular customer, in the left corner a icon is present which allows to create an attachment.

I did create an attachment. Now, I need to develop a report whose o/p is of format as below.

kunnr attachment size date last uploaded .

Kunnr comes from kna1 table and remaining other 3 fields comes from sood table.

I need a solution to find a relationship between these 2 tables so that i can get the o/p as mentioned above.

Kunnr attachment size date last uploaded

104560 ekko.doc 150KB 20.04.2006

Regards

Venu

1 ACCEPTED SOLUTION

Former Member
0 Kudos

HI Venu,

I guess the only field that is common to both the fields is MANDT field. Try making use of the same to establish a relation between them for the required output. I have checked both the tables throughly there is no field other than MANDT common to both the tables.

REgards,

Santosh

13 REPLIES 13

Former Member
0 Kudos

HI Venu,

I guess the only field that is common to both the fields is MANDT field. Try making use of the same to establish a relation between them for the required output. I have checked both the tables throughly there is no field other than MANDT common to both the tables.

REgards,

Santosh

0 Kudos

Please try this sample program. This works for attachments, not URLs, if you want URLs, replace ATTA with URL. The data that you get in the IDOCS internal table, I think you will be able to link to SOOD.

report zrich_0001.





data: xobject like borident.
data: idocs type standard table of neighbor.
data: xdocs type neighbor.


parameters: p_kunnr type kna1-kunnr.


* Retrieve Documents via task list/counter
xobject-objtype = 'KNA1'.
xobject-objkey  = p_kunnr.

clear idocs. refresh idocs.
call function 'SREL_GET_NEXT_NEIGHBORS'
     exporting
          object       = xobject
          roletype     = 'APPLOBJ'
          relationtype = 'ATTA'
     tables
          neighbors    = idocs.



loop at idocs into xdocs.
  write:/ xdocs-objkey.
endloop.

Regards,

Rich Heilman

0 Kudos

Hi rich,

I tried with the function module. I dont know what the function module does, but when i went into se37 and put values of xobject-objtype->kna1

and xobject-objkey-> kunnr value,

and roletype = 'APPLOBJ'

relationtype = 'ATTA', and execute it, no values are getting populated in the table neighbors. So i guess, this function module isn't serving the purpose.

Can you check this..

Regs..

Venu

0 Kudos

Make sure that you are putting the KUNNR in the objkey with LEADING ZEROS. I have tested this code in my 46c system. It worked good for me.

Regards,

Rich Heilman

0 Kudos

Hi rich,

Thanks for your help. It's working fine. I appreciate your help. But there is a small problem. I actually need it for another transaction in Project syatems, TCODE is cj20n, which is similiar to xd02. The table is PROJ similiar to KNA1. the field is PSPID similiar to kunnr. I tried to do the same stuff in the function module. It's working fine for kunnr, but not for pspid.,I tried using various options for the same value of pspid 1LO-100000001, 1LO100000001, 00000054(this value we get using Function module-> CONVERSION_EXIT_KONPD_INPUT), 54 and also

000000000001LO-100000001. But none of these work. I tried to debug the function module putting the 2 values, kunnr and pspid, but dunno if the solution is simple and if you are aware with project systems.

I appreciate your time and help.

Regrds

Venu

0 Kudos

Please try 'BUS2001' as the object type, the key will need to be the value of PSPID with the correct formatting.

Regards,

rich Heilman

0 Kudos

Hi rich,

I tried using BUS2001 with all possible formatted values i can think of for pspid. It isn't working. Is there any other parameter which needs to changed(I dont know what ATTA or APPLOBJ means ) or any other change needs to be done. Sorry for troubling you..

Appreciate your help.

Regards

Venu

p.s:) If nothing works i would debug the F. Module with kunnr and pspid values and see where the error occurs

0 Kudos

The way that I would the KNA1 is I debugged XD02 , where I clicked on the attachment list menu option, I then stepped thru the code untill I found the object type. You could try the same.

Regards,

Rich Heilman

0 Kudos

I've just debugged it, the TYPE is BUS2001. There may be a problem with your key.

Regards,

Rich Heilman

0 Kudos

Yes, it needs a combination of both PSPNR and PSPID. PSPID is first.




xbor-objkey = 'BUS2001'.
concatenate PROJ-PSPID PROJ-PSPNR into xbor-objkey.

Regards,

Rich Heilman

0 Kudos

Hi Rich,

Thanks for your help. It worked fine. I had to search another table to check the format so that I could keep enuf space between pspid and pspnr. I really appreciate your help.

Without your help, it would have taken me lots of time to search the F.module and other stuff.

I appreciate your time .

Regards

Venu

0 Kudos

So if your problem is solved, please mark it as such. Thanks.

And......your quite welcome.

Regards,

Rich Heilman

0 Kudos

Hi rich,

Hope you do remember this query regarding sood table.

I have created an attachment list in project system(cj20n transaction), all the details like the file name, created time and size of the file comes in sood table.

But the problem is the attchment size comes fine only for .txt file. in the sood table for other types like excel type, the file name and date created everything comes fine, but the size of the file always gives 0.

is there any other table from where I can check for the size of the attchments for excel file or any other file.

Regards

Venu