문제 설명
ALV 레이아웃의 표시된 모든 열을 제거하는 방법 (How to remove all displayed columns of ALV layout)
스크립트를 사용하여 SAP에서 Excel로 데이터를 내보내고 있습니다. 목표는 이 매크로를 실행하려는 모든 사람이 사용할 수 있도록 하는 것이지만, SAP 레이아웃이 다른 경우 매크로가 엉망이 됩니다. 코드를 파헤쳐 보면 SAP가 각 행에 숫자 값을 할당하는 것처럼 보입니다. 따라서 매크로는 SAP 트랜잭션을 실행한 다음 레이아웃을 변경하고 참조하는 번호에 따라 레이아웃에 표시된 모든 열을 오른쪽으로 덤프합니다. 이제 마지막 열이 항상 같기 때문에 실행할 때 잘 작동하지만 레이아웃이 다른 사람이 실행하면 일부 필드만 제거됩니다.
궁금한 점 VBA에 현재 코드가 아닌 모든 행을 선택하거나 "표시된 열" 버킷을 완전히 지우는 방법이 있는 경우:<
참조 솔루션
방법 1:
Found the answer shortly after posting. Instead of using:
.selectedRows = "0‑27"
I used:
.selectAll
This grabbed everything in the field so I could then repopulate with the information I needed.